UNPKG

synt_backend

Version:

Synt light-weight node backend service

108 lines (107 loc) 2.42 kB
"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.createTable("Incidents", { 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", }, VMEId: { type: Sequelize.INTEGER, references: { model: "VMEs", key: "id", }, allowNull: true, defaultValue: Sequelize.UUIDV4, onUpdate: "CASCADE", onDelete: "SET NULL", }, ReportTypeId: { type: Sequelize.INTEGER, references: { model: "ReportTypes", key: "id", }, allowNull: false, defaultValue: Sequelize.UUIDV4, onUpdate: "CASCADE", onDelete: "RESTRICT", }, SupplierId: { type: Sequelize.INTEGER, references: { model: "Suppliers", key: "id", }, allowNull: true, defaultValue: Sequelize.UUIDV4, onUpdate: "CASCADE", onDelete: "RESTRICT", }, token: { type: Sequelize.STRING(6), }, report_description: { type: Sequelize.STRING, }, is_urgent: { type: Sequelize.BOOLEAN, }, has_tried_to_call: { type: Sequelize.BOOLEAN, }, has_called: { type: Sequelize.BOOLEAN, }, is_covered: { allowNull: true, type: Sequelize.BOOLEAN, }, call_description: { type: Sequelize.STRING, }, declaration: { type: Sequelize.JSON, }, case: { type: Sequelize.JSON, }, case_id: { type: Sequelize.INTEGER, }, solved_at: { allowNull: true, type: Sequelize.DATE, }, createdAt: { allowNull: false, type: Sequelize.DATE, }, updatedAt: { allowNull: false, type: Sequelize.DATE, }, deletedAt: { allowNull: true, type: Sequelize.DATE, }, }); }, down: async (queryInterface) => { await queryInterface.dropTable("Incidents"); }, };