'use strict';
const { defaultKeys, migrationDefaults, relationShip } = require('../sequelize/defaults');
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('user_rights', {
      ...defaultKeys("user_rights_id"),
      user_id: relationShip({
        modelName: "users",
        key: "user_id",
        allowNull: false,
      }),
      user_rights_permission: {
        type: Sequelize.TEXT(),
        allowNull: true,
      },
      ...migrationDefaults(),
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('user_rights');
  }
};