text: 'use strict';
  
  module.exports = {
    up: async (queryInterface, Sequelize) => {
      return queryInterface.createTable('delivery_problems', {
        id: {
          type: Sequelize.INTEGER,
          allowNull: false,
          primaryKey: true,
          autoIncrement: true
        },
        delivery_id: {
          type: Sequelize.INTEGER,
          allowNull: false,
          references: { model: 'orders', key: 'id' },
          onUpdate: 'CASCADE',
          onDelete: 'CASCADE'
        },
        description: {
          type: Sequelize.STRING,
          allowNull: false
        },
        created_at: {
          type: Sequelize.DATE,
          allowNull: false
        },
        updated_at: {
          type: Sequelize.DATE,
          allowNull: false
        }
      })
    },
  
    down: async (queryInterface) => {
      return queryInterface.dropTable('delivery_problems');
    }
  };
  