Files
pp-tcms/backend/migrations/20240212082050-create-runs.js

48 lines
964 B
JavaScript

export async function up(queryInterface, Sequelize) {
await queryInterface.createTable('runs', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
},
name: {
type: Sequelize.STRING,
allowNull: false,
},
configurations: {
type: Sequelize.STRING,
allowNull: true,
},
description: {
type: Sequelize.STRING,
allowNull: true,
},
state: {
type: Sequelize.INTEGER,
allowNull: true,
},
projectId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'projects',
key: 'id',
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
createdAt: {
allowNull: false,
type: Sequelize.DATE,
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE,
},
});
}
export async function down(queryInterface) {
await queryInterface.dropTable('runs');
}