text: const { roles } = require('../../src/config/roles');
  const { tokenTypes } = require('../../src/config/tokens');
  
  module.exports = {
    up: async (queryInterface, Sequelize) => {
      await queryInterface.createTable('User', {
        id: {
          allowNull: false,
          autoIncrement: true,
          primaryKey: true,
          type: Sequelize.INTEGER,
        },
        name: {
          type: Sequelize.STRING,
          allowNull: false,
        },
        email: {
          type: Sequelize.STRING,
          allowNull: false,
          unique: true,
        },
        password: {
          type: Sequelize.STRING,
          allowNull: false,
        },
        role: {
          type: Sequelize.ENUM,
          allowNull: false,
          values: roles,
          default: 'user',
        },
        isEmailVerified: {
          type: Sequelize.BOOLEAN,
          allowNull: false,
          default: false,
        },
        createdAt: {
          allowNull: false,
          type: Sequelize.DATE,
        },
        updatedAt: {
          allowNull: false,
          type: Sequelize.DATE,
        },
        deletedAt: {
          allowNull: true,
          type: Sequelize.DATE,
        },
      });
  
      await queryInterface.createTable('Token', {
        id: {
          allowNull: false,
          autoIncrement: true,
          primaryKey: true,
          type: Sequelize.INTEGER,
        },
        token: {
          type: Sequelize.STRING,
          allowNull: false,
        },
        user: {
          type: Sequelize.INTEGER,
          allowNull: false,
          references: {
            model: 'User',
            key: 'id',
          },
          onUpdate: 'cascade',
          onDelete: 'cascade',
        },
        type: {
          type: Sequelize.ENUM,
          allowNull: false,
          values: [tokenTypes.REFRESH, tokenTypes.RESET_PASSWORD, tokenTypes.VERIFY_EMAIL],
        },
        expires: {
          type: Sequelize.DATE,
          allowNull: false,
        },
        blacklisted: {
          type: Sequelize.BOOLEAN,
          default: false,
        },
        createdAt: {
          allowNull: false,
          type: Sequelize.DATE,
        },
        updatedAt: {
          allowNull: false,
          type: Sequelize.DATE,
        },
      });
    },
    // eslint-disable-next-line no-unused-vars
    down: async (queryInterface, Sequelize) => {
      await queryInterface.dropTable('User');
      await queryInterface.dropTable('Token');
    },
  };
  