mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
32 lines
1.4 KiB
JavaScript
32 lines
1.4 KiB
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
async up(queryInterface) {
|
|
await queryInterface.dropTable('file_uploads', { cascade: true });
|
|
await queryInterface.dropTable('course_roles', { cascade: true });
|
|
await queryInterface.dropTable('course_products', { cascade: true });
|
|
},
|
|
|
|
async down(queryInterface, Sequelize) {
|
|
await queryInterface.createTable('file_uploads', {
|
|
id: { type: Sequelize.BIGINT, primaryKey: true, autoIncrement: true },
|
|
createdAt: { type: Sequelize.DATE, allowNull: false },
|
|
updatedAt: { type: Sequelize.DATE, allowNull: false },
|
|
});
|
|
await queryInterface.createTable('course_roles', {
|
|
id: { type: Sequelize.BIGINT, primaryKey: true, autoIncrement: true },
|
|
course_id: { type: Sequelize.BIGINT, allowNull: false },
|
|
role_id: { type: Sequelize.BIGINT, allowNull: false },
|
|
createdAt: { type: Sequelize.DATE, allowNull: false },
|
|
updatedAt: { type: Sequelize.DATE, allowNull: false },
|
|
});
|
|
await queryInterface.createTable('course_products', {
|
|
id: { type: Sequelize.BIGINT, primaryKey: true, autoIncrement: true },
|
|
course_id: { type: Sequelize.BIGINT, allowNull: false },
|
|
product_id: { type: Sequelize.BIGINT, allowNull: false },
|
|
createdAt: { type: Sequelize.DATE, allowNull: false },
|
|
updatedAt: { type: Sequelize.DATE, allowNull: false },
|
|
});
|
|
},
|
|
};
|