text: 'use strict'
  module.exports = {
    up: async (queryInterface, Sequelize) => {
      await queryInterface.createTable('reviews', {
        id: {
          allowNull: false,
          autoIncrement: true,
          primaryKey: true,
          type: Sequelize.INTEGER
        },
        carId: {
          field: 'car_id',
          type: Sequelize.INTEGER,
          allowNull: false,
          references: {
            model: 'cars',
            key: 'id'
          }
        },
        userId: {
          field: 'user_id',
          type: Sequelize.INTEGER,
          allowNull: false,
          references: {
            model: 'users',
            key: 'id'
          }
        },
        name: {
          type: Sequelize.STRING,
          allowNull: false
        },
        rating: {
          type: Sequelize.INTEGER,
          allowNull: false
        },
        comment: {
          type: Sequelize.STRING,
          allowNull: false
        },
        createdAt: {
          field: 'created_at',
          allowNull: false,
          type: Sequelize.DATEONLY,
          defaultValue: new Date()
        },
        updatedAt: {
          field: 'updated_at',
          allowNull: false,
          type: Sequelize.DATEONLY,
          defaultValue: new Date()
        }
      })
    },
    down: async (queryInterface, Sequelize) => {
      await queryInterface.dropTable('reviews')
    }
  }
  