2024-10-14 08:35:26 +00:00
|
|
|
const { Sequelize } = require("sequelize");
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
async up(queryInterface) {
|
|
|
|
|
await queryInterface.createTable("report", {
|
|
|
|
|
ID_REPORT: {
|
|
|
|
|
type: Sequelize.UUID,
|
|
|
|
|
primaryKey: true,
|
|
|
|
|
defaultValue: Sequelize.UUIDV4,
|
|
|
|
|
allowNull: false,
|
|
|
|
|
},
|
|
|
|
|
ID: {
|
|
|
|
|
type: Sequelize.UUID,
|
|
|
|
|
allowNull: false,
|
|
|
|
|
},
|
|
|
|
|
REPORTS: {
|
2024-11-06 06:12:13 +00:00
|
|
|
type: Sequelize.TEXT,
|
2024-10-14 08:35:26 +00:00
|
|
|
allowNull: false,
|
|
|
|
|
},
|
|
|
|
|
TIME_REPORT: {
|
|
|
|
|
type: Sequelize.DATE,
|
|
|
|
|
allowNull: true,
|
|
|
|
|
defaultValue: Sequelize.NOW,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await queryInterface.addConstraint("report", {
|
|
|
|
|
fields: ["ID"],
|
|
|
|
|
type: "foreign key",
|
|
|
|
|
name: "FK_MELAPORKAN",
|
|
|
|
|
references: {
|
|
|
|
|
table: "users",
|
|
|
|
|
field: "ID",
|
|
|
|
|
},
|
|
|
|
|
onUpdate: "CASCADE",
|
|
|
|
|
onDelete: "CASCADE",
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async down(queryInterface) {
|
|
|
|
|
await queryInterface.dropTable("report");
|
|
|
|
|
},
|
|
|
|
|
};
|