feat(tags): add tags to test cases (#299)
This commit is contained in:
35
backend/migrations/20251009180204-create-tags.js
Normal file
35
backend/migrations/20251009180204-create-tags.js
Normal file
@@ -0,0 +1,35 @@
|
||||
export async function up(queryInterface, Sequelize) {
|
||||
await queryInterface.createTable('tags', {
|
||||
id: {
|
||||
type: Sequelize.INTEGER,
|
||||
autoIncrement: true,
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
},
|
||||
name: {
|
||||
type: Sequelize.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
projectId: {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: 'projects',
|
||||
key: 'id',
|
||||
},
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function down(queryInterface) {
|
||||
await queryInterface.dropTable('tags');
|
||||
}
|
||||
40
backend/migrations/20251009191250-create-caseTags.js
Normal file
40
backend/migrations/20251009191250-create-caseTags.js
Normal file
@@ -0,0 +1,40 @@
|
||||
export async function up(queryInterface, Sequelize) {
|
||||
await queryInterface.createTable('caseTags', {
|
||||
id: {
|
||||
type: Sequelize.INTEGER,
|
||||
autoIncrement: true,
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
},
|
||||
caseId: {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: 'cases',
|
||||
key: 'id',
|
||||
},
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
tagId: {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: 'tags',
|
||||
key: 'id',
|
||||
},
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
createdAt: {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: false,
|
||||
},
|
||||
updatedAt: {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function down(queryInterface) {
|
||||
await queryInterface.dropTable('caseTags');
|
||||
}
|
||||
Reference in New Issue
Block a user