Files
outline/server/migrations/20160824061730-add-apikeys.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

40 lines
874 B
JavaScript

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable("apiKeys", {
id: {
type: "UUID",
allowNull: false,
primaryKey: true,
},
name: {
type: "CHARACTER VARYING",
allowNull: true,
},
secret: {
type: "CHARACTER VARYING",
allowNull: false,
unique: true,
},
userId: {
type: "UUID",
allowNull: true,
},
createdAt: {
type: "TIMESTAMP WITH TIME ZONE",
allowNull: false,
},
updatedAt: {
type: "TIMESTAMP WITH TIME ZONE",
allowNull: false,
},
deletedAt: {
type: "TIMESTAMP WITH TIME ZONE",
allowNull: true,
},
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable("apiKeys");
},
};