mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
35 lines
842 B
JavaScript
35 lines
842 B
JavaScript
'use strict'
|
|
|
|
module.exports = {
|
|
up: (queryInterface, Sequelize) => {
|
|
return queryInterface.createTable('user_followers', {
|
|
userId: {
|
|
type: Sequelize.INTEGER,
|
|
references: {
|
|
model: 'users',
|
|
key: 'id'
|
|
},
|
|
primaryKey: true,
|
|
allowNull: false,
|
|
onUpdate: 'CASCADE',
|
|
onDelete: 'CASCADE'
|
|
},
|
|
fedUserApId: {
|
|
primaryKey: true,
|
|
type: Sequelize.STRING,
|
|
references: {
|
|
model: 'fed_users',
|
|
key: 'ap_id'
|
|
},
|
|
onUpdate: 'CASCADE',
|
|
onDelete: 'CASCADE'
|
|
},
|
|
createdAt: { type: Sequelize.DATE, allowNull: false },
|
|
updatedAt: { type: Sequelize.DATE, allowNull: false }
|
|
})
|
|
},
|
|
|
|
down: (queryInterface, Sequelize) => {
|
|
return queryInterface.dropTable('user_followers')
|
|
}
|
|
}
|