UNPKG

@grouparoo/core

Version:
57 lines (56 loc) 1.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = { up: async (queryInterface, DataTypes) => { await queryInterface.createTable("logs", { guid: { type: DataTypes.STRING(40), primaryKey: true, }, createdAt: { type: DataTypes.DATE, allowNull: false, }, updatedAt: { type: DataTypes.DATE, allowNull: false, }, ownerGuid: { type: DataTypes.STRING(40), allowNull: false, }, topic: { type: DataTypes.STRING(191), allowNull: false, }, verb: { type: DataTypes.STRING(191), allowNull: false, }, who: { type: DataTypes.STRING(191), allowNull: true, }, message: { type: DataTypes.TEXT, allowNull: false, }, data: { type: DataTypes.TEXT, allowNull: false, }, }); await queryInterface.addIndex("logs", ["topic"], { fields: ["topic"], }); await queryInterface.addIndex("logs", ["ownerGuid"], { fields: ["ownerGuid"], }); await queryInterface.addIndex("logs", ["createdAt"], { fields: ["createdAt"], }); }, down: async (queryInterface) => { await queryInterface.dropTable("logs"); }, };