chore: Unify backend express project into ESM (#281)

This commit is contained in:
kimatata
2025-09-15 22:46:46 +09:00
committed by GitHub
parent 72fd3af24f
commit 761869736e
83 changed files with 2129 additions and 2328 deletions

View File

@@ -1,52 +1,47 @@
'use strict';
export async function up(queryInterface, Sequelize) {
await queryInterface.createTable('caseSteps', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
},
caseId: {
type: Sequelize.INTEGER,
references: {
model: 'cases',
key: 'id',
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
stepId: {
type: Sequelize.INTEGER,
references: {
model: 'steps',
key: 'id',
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
stepNo: {
type: Sequelize.INTEGER,
allowNull: false,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
},
});
/** @type {import('sequelize-cli').Migration} */
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('caseSteps', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
},
caseId: {
type: Sequelize.INTEGER,
references: {
model: 'cases',
key: 'id',
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
stepId: {
type: Sequelize.INTEGER,
references: {
model: 'steps',
key: 'id',
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
stepNo: {
type: Sequelize.INTEGER,
allowNull: false,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
},
});
await queryInterface.addIndex('caseSteps', ['caseId', 'stepId'], {
unique: true,
});
}
await queryInterface.addIndex('caseSteps', ['caseId', 'stepId'], {
unique: true,
});
},
down: async (queryInterface) => {
await queryInterface.dropTable('caseSteps');
},
};
export async function down(queryInterface) {
await queryInterface.dropTable('caseSteps');
}