mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
chore: relocate backend into apps/api ahead of monorepo merge
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
async up(queryInterface, Sequelize) {
|
||||
await queryInterface.createTable('announcement_roles', {
|
||||
id: {
|
||||
type: Sequelize.BIGINT,
|
||||
autoIncrement: true,
|
||||
primaryKey: true,
|
||||
},
|
||||
announcement_id: {
|
||||
type: Sequelize.BIGINT,
|
||||
allowNull: false,
|
||||
references: { model: 'announcements', key: 'id' },
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
role: {
|
||||
type: Sequelize.STRING(50),
|
||||
allowNull: false,
|
||||
},
|
||||
});
|
||||
|
||||
await queryInterface.addConstraint('announcement_roles', {
|
||||
fields: ['announcement_id', 'role'],
|
||||
type: 'unique',
|
||||
name: 'uq_announcement_roles',
|
||||
});
|
||||
|
||||
await queryInterface.addIndex('announcement_roles', { fields: ['announcement_id'], name: 'idx_announcement_roles_ann_id' });
|
||||
},
|
||||
|
||||
async down(queryInterface) {
|
||||
await queryInterface.dropTable('announcement_roles');
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user