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
57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
await queryInterface.createTable("collection_users", {
|
|
collectionId: {
|
|
type: Sequelize.UUID,
|
|
allowNull: false,
|
|
references: {
|
|
model: "collections",
|
|
},
|
|
},
|
|
userId: {
|
|
type: Sequelize.UUID,
|
|
allowNull: false,
|
|
references: {
|
|
model: "users",
|
|
},
|
|
},
|
|
permission: {
|
|
type: Sequelize.STRING,
|
|
allowNull: false,
|
|
},
|
|
createdById: {
|
|
type: Sequelize.UUID,
|
|
allowNull: false,
|
|
references: {
|
|
model: "users",
|
|
},
|
|
},
|
|
createdAt: {
|
|
type: Sequelize.DATE,
|
|
allowNull: false,
|
|
},
|
|
updatedAt: {
|
|
type: Sequelize.DATE,
|
|
allowNull: false,
|
|
},
|
|
});
|
|
await queryInterface.addColumn("collections", "private", {
|
|
type: Sequelize.BOOLEAN,
|
|
allowNull: false,
|
|
defaultValue: false,
|
|
});
|
|
await queryInterface.addIndex("collection_users", [
|
|
"collectionId",
|
|
"userId",
|
|
]);
|
|
},
|
|
down: async (queryInterface, Sequelize) => {
|
|
await queryInterface.dropTable("collection_users");
|
|
await queryInterface.removeColumn("collections", "private");
|
|
await queryInterface.removeIndex("collection_users", [
|
|
"collectionId",
|
|
"userId",
|
|
]);
|
|
},
|
|
};
|