create cases table

This commit is contained in:
Takeshi Kimata
2024-02-12 18:47:39 +09:00
parent b23922c8e5
commit 291bad6d56
9 changed files with 255 additions and 4 deletions

View File

@@ -0,0 +1,72 @@
'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up (queryInterface, Sequelize) {
await queryInterface.createTable('cases', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
},
folderId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'folders',
key: 'id',
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
title: {
type: Sequelize.STRING,
allowNull: false,
},
state: {
type: Sequelize.INTEGER,
allowNull: false,
},
priority: {
type: Sequelize.INTEGER,
allowNull: false,
},
type: {
type: Sequelize.INTEGER,
allowNull: false,
},
automationStatus: {
type: Sequelize.INTEGER,
allowNull: false,
},
description: {
type: Sequelize.STRING,
allowNull: true,
},
template: {
type: Sequelize.INTEGER,
allowNull: false,
},
preConditions: {
type: Sequelize.STRING,
allowNull: true,
},
expectedResults: {
type: Sequelize.STRING,
allowNull: true,
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
async down (queryInterface, Sequelize) {
await queryInterface.dropTable('cases');
}
};