diff --git a/server/api/models/comment.js b/server/api/models/comment.js index 7b836812..793ab8e0 100644 --- a/server/api/models/comment.js +++ b/server/api/models/comment.js @@ -2,7 +2,7 @@ module.exports = (sequelize, DataTypes) => { const comment = sequelize.define('comment', { activitypub_id: { - type: DataTypes.STRING(18), + type: DataTypes.STRING, index: true, unique: true }, diff --git a/server/migrations/20191112101545-ap_comment_id.js b/server/migrations/20191112101545-ap_comment_id.js new file mode 100644 index 00000000..6a7f2b4d --- /dev/null +++ b/server/migrations/20191112101545-ap_comment_id.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.changeColumn('comments', 'activitypub_id', { + type: Sequelize.STRING, + index: true, + unique: true + }) + }, + + down: (queryInterface, Sequelize) => { + return queryInterface.changeColumn('comments', 'activitypub_id', { + type: Sequelize.STRING(18), + index: true, + unique: true + }) + } +}