mirror of
https://github.com/Troplo/Colubrina.git
synced 2024-11-23 11:46:44 +11:00
55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
|
"use strict"
|
||
|
|
||
|
module.exports = {
|
||
|
async up(queryInterface, Sequelize) {
|
||
|
await queryInterface.createTable("Attachments", {
|
||
|
id: {
|
||
|
type: Sequelize.BIGINT,
|
||
|
primaryKey: true,
|
||
|
autoIncrement: true
|
||
|
},
|
||
|
name: {
|
||
|
type: Sequelize.STRING,
|
||
|
allowNull: false
|
||
|
},
|
||
|
attachment: {
|
||
|
type: Sequelize.STRING,
|
||
|
allowNull: false
|
||
|
},
|
||
|
type: {
|
||
|
type: Sequelize.ENUM(["message", "avatar"]),
|
||
|
allowNull: false,
|
||
|
defaultValue: "message"
|
||
|
},
|
||
|
size: {
|
||
|
type: Sequelize.BIGINT,
|
||
|
allowNull: false
|
||
|
},
|
||
|
extension: {
|
||
|
type: Sequelize.STRING,
|
||
|
allowNull: true
|
||
|
},
|
||
|
userId: {
|
||
|
type: Sequelize.BIGINT,
|
||
|
allowNull: false
|
||
|
},
|
||
|
chatId: {
|
||
|
type: Sequelize.BIGINT,
|
||
|
allowNull: true
|
||
|
},
|
||
|
createdAt: {
|
||
|
type: Sequelize.DATE,
|
||
|
allowNull: false
|
||
|
},
|
||
|
updatedAt: {
|
||
|
type: Sequelize.DATE,
|
||
|
allowNull: false
|
||
|
}
|
||
|
})
|
||
|
},
|
||
|
|
||
|
async down(queryInterface, Sequelize) {
|
||
|
await queryInterface.dropTable("Attachments")
|
||
|
}
|
||
|
}
|