Colubrina/backend/migrations/20220330072146-communicationAssociations.js

45 lines
919 B
JavaScript
Raw Normal View History

2022-06-05 22:58:18 +10:00
"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');
*/
}
}