feat(tags): add tags to test cases (#299)

This commit is contained in:
Eliezer Castro
2025-10-15 19:18:09 -03:00
committed by GitHub
parent 8fe288e875
commit 1ebf1a1572
17 changed files with 567 additions and 1 deletions

View 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');
}

View 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');
}