create attachment file table

This commit is contained in:
Takeshi Kimata
2024-03-16 21:14:59 +09:00
parent f5a2eb24fb
commit afb58585fa
12 changed files with 273 additions and 6 deletions

View File

@@ -0,0 +1,38 @@
'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up (queryInterface, Sequelize) {
await queryInterface.createTable('attachments', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
},
title: {
type: Sequelize.STRING,
allowNull: false,
},
detail: {
type: Sequelize.STRING,
allowNull: true,
},
path: {
type: Sequelize.STRING,
allowNull: false,
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
async down (queryInterface, Sequelize) {
await queryInterface.dropTable('attachments');
}
};