Files
outline/server/migrations/20250306181804-create-imports.js
T
2025-03-07 01:30:42 +05:30

57 lines
1.2 KiB
JavaScript

"use strict";
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable("imports", {
id: {
type: Sequelize.UUID,
allowNull: false,
primaryKey: true,
},
service: {
type: Sequelize.STRING,
allowNull: false,
},
state: {
type: Sequelize.STRING,
allowNull: false,
},
data: {
type: Sequelize.JSONB,
allowNull: false,
},
pendingTaskCount: {
type: Sequelize.INTEGER,
allowNull: false,
},
createdById: {
type: Sequelize.UUID,
allowNull: false,
references: {
model: "users",
},
},
integrationId: {
type: Sequelize.UUID,
allowNull: false,
references: {
model: "integrations",
},
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
},
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable("imports");
},
};