Colubrina/backend/migrations/20220330072146-communicatio...

45 lines
919 B
JavaScript

"use strict"
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable("ChatAssociations", {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT
},
chatId: {
type: Sequelize.BIGINT,
allowNull: false
},
userId: {
type: Sequelize.BIGINT,
allowNull: false
},
rank: {
type: Sequelize.ENUM(["member", "admin"]),
defaultValue: "member",
allowNull: false
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
})
},
down: async (queryInterface, Sequelize) => {
/**
* Add reverting commands here.
*
* Example:
* await queryInterface.dropTable('users');
*/
}
}