extended editor
This commit is contained in:
38
migrations/20240621071827-create-page-files-table.js
Normal file
38
migrations/20240621071827-create-page-files-table.js
Normal file
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.createTable('page_files', {
|
||||
pageId: {
|
||||
type: Sequelize.INTEGER,
|
||||
references: {
|
||||
model: 'pages',
|
||||
key: 'id'
|
||||
},
|
||||
onUpdate: 'CASCADE',
|
||||
onDelete: 'CASCADE'
|
||||
},
|
||||
fileId: {
|
||||
type: Sequelize.INTEGER,
|
||||
references: {
|
||||
model: 'files',
|
||||
key: 'id'
|
||||
},
|
||||
onUpdate: 'CASCADE',
|
||||
onDelete: 'CASCADE'
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.dropTable('page_files');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user