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/20200915010511-create-searc...

44 lines
943 B
JavaScript

"use strict";
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable("search_queries", {
id: {
allowNull: false,
primaryKey: true,
type: Sequelize.UUID,
},
userId: {
type: Sequelize.UUID,
references: {
model: "users",
},
},
teamId: {
type: Sequelize.UUID,
references: {
model: "teams",
},
},
source: {
type: Sequelize.ENUM("slack", "app", "api"),
allowNull: false,
},
query: {
type: Sequelize.STRING,
allowNull: false,
},
results: {
type: Sequelize.INTEGER,
allowNull: false,
},
createdAt: {
allowNull: false,
type: Sequelize.DATE,
},
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable("search_queries");
},
};