import { DataTypes } from 'sequelize';
import { safeApplyColumnChanges, type Migration } from '../migrate';

export const up: Migration = async ({ context }) => {
  await safeApplyColumnChanges(context, {
    prices: [
      {
        name: 'tax_behavior',
        field: {
          type: DataTypes.ENUM('inclusive', 'exclusive'),
          allowNull: false,
          defaultValue: 'inclusive',
        },
      },
    ],
  });
};

export const down: Migration = async ({ context }) => {
  await context.removeColumn('prices', 'tax_behavior');
};
