UNPKG

synt_backend

Version:

Synt light-weight node backend service

53 lines (52 loc) 1.2 kB
"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.createTable("IncidentComments", { id: { allowNull: false, autoIncrement: true, primaryKey: true, type: Sequelize.INTEGER, }, UserId: { type: Sequelize.INTEGER, references: { model: "Users", key: "id", }, allowNull: true, defaultValue: Sequelize.UUIDV4, onUpdate: "CASCADE", onDelete: "SET NULL", }, IncidentId: { type: Sequelize.INTEGER, references: { model: "Incidents", key: "id", }, allowNull: true, defaultValue: Sequelize.UUIDV4, onUpdate: "CASCADE", onDelete: "SET NULL", }, user_name: { type: Sequelize.STRING, }, message: { type: Sequelize.TEXT, }, createdAt: { allowNull: false, type: Sequelize.DATE, }, updatedAt: { allowNull: false, type: Sequelize.DATE, }, }); }, down: async (queryInterface) => { await queryInterface.dropTable("IncidentComments"); }, };