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
55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
"use strict";
|
|
|
|
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
await queryInterface.createTable("collection_groups", {
|
|
collectionId: {
|
|
type: Sequelize.UUID,
|
|
allowNull: false,
|
|
references: {
|
|
model: "collections",
|
|
},
|
|
},
|
|
groupId: {
|
|
type: Sequelize.UUID,
|
|
allowNull: false,
|
|
references: {
|
|
model: "groups",
|
|
},
|
|
},
|
|
createdById: {
|
|
type: Sequelize.UUID,
|
|
allowNull: false,
|
|
references: {
|
|
model: "users",
|
|
},
|
|
},
|
|
permission: {
|
|
type: Sequelize.STRING,
|
|
allowNull: false,
|
|
},
|
|
createdAt: {
|
|
type: Sequelize.DATE,
|
|
allowNull: false,
|
|
},
|
|
updatedAt: {
|
|
type: Sequelize.DATE,
|
|
allowNull: false,
|
|
},
|
|
deletedAt: {
|
|
type: Sequelize.DATE,
|
|
allowNull: true,
|
|
},
|
|
});
|
|
await queryInterface.addIndex("collection_groups", [
|
|
"collectionId",
|
|
"groupId",
|
|
]);
|
|
await queryInterface.addIndex("collection_groups", ["groupId"]);
|
|
await queryInterface.addIndex("collection_groups", ["deletedAt"]);
|
|
},
|
|
down: async (queryInterface, Sequelize) => {
|
|
return queryInterface.dropTable("collection_groups");
|
|
},
|
|
};
|