This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/server/migrations/20160824061730-add-apikeys.js

45 lines
953 B
JavaScript

module.exports = {
up: function(queryInterface, Sequelize) {
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,
// references: {
// model: 'users',
// key: 'id',
// },
},
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: function(queryInterface, Sequelize) {
queryInterface.dropTable('apiKeys');
},
};