20210609141319-log.js 882 Bytes
'use strict';
module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.createTable('Logs', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      },
      user: {
        type: Sequelize.INTEGER
      },
      location: {
        type: Sequelize.STRING(191),
      },
      module: {
        type: Sequelize.STRING(191),
      },
      actionType: {
        type: Sequelize.STRING(191)
      },
      data: {
        type: Sequelize.JSON
      },
      ipAddress:{
        type: Sequelize.STRING(191)
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      }
    },{
      charset: 'utf8mb4',
      collate: 'utf8mb4_unicode_ci'
    })
  },
  down: async (queryInterface, Sequelize) => {
    await queryInterface.dropTable('Logs');
  }
};