GladysProject/Gladys

View on GitHub
server/migrations/20190211044839-create-dashboard.js

Summary

Maintainability
A
1 hr
Test Coverage
module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.createTable('t_dashboard', {
      id: {
        allowNull: false,
        primaryKey: true,
        type: Sequelize.UUID,
      },
      name: {
        allowNull: false,
        unique: true,
        type: Sequelize.STRING,
      },
      type: {
        allowNull: false,
        type: Sequelize.STRING,
      },
      selector: {
        allowNull: false,
        unique: true,
        type: Sequelize.STRING,
      },
      boxes: {
        allowNull: false,
        type: Sequelize.JSON,
      },
      created_at: {
        allowNull: false,
        type: Sequelize.DATE,
      },
      updated_at: {
        allowNull: false,
        type: Sequelize.DATE,
      },
    });
  },
  down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_dashboard'),
};