Files
outline/server/migrations/20190606035733-events.js
Tom Moor 15b1069bcc chore: Move to Typescript (#2783)
This PR moves the entire project to Typescript. Due to the ~1000 ignores this will lead to a messy codebase for a while, but the churn is worth it – all of those ignore comments are places that were never type-safe previously.

closes #1282
2021-11-29 06:40:55 -08:00

35 lines
1.2 KiB
JavaScript

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.changeColumn("events", "data", {
type: Sequelize.JSONB,
allowNull: true,
});
await queryInterface.addColumn("events", "actorId", {
type: Sequelize.UUID,
allowNull: true,
references: {
model: "users",
},
});
await queryInterface.addColumn("events", "modelId", {
type: Sequelize.UUID,
allowNull: true,
});
await queryInterface.addColumn("events", "ip", {
type: Sequelize.STRING,
allowNull: true,
});
await queryInterface.addIndex("events", ["name"]);
await queryInterface.addIndex("events", ["actorId"]);
await queryInterface.addIndex("events", ["teamId", "collectionId"]);
},
down: async (queryInterface, Sequelize) => {
await queryInterface.removeColumn("events", "actorId");
await queryInterface.removeColumn("events", "modelId");
await queryInterface.removeColumn("events", "ip");
await queryInterface.removeIndex("events", ["name"]);
await queryInterface.removeIndex("events", ["actorId"]);
await queryInterface.removeIndex("events", ["teamId", "collectionId"]);
},
};