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

export const up: Migration = async ({ context }) => {
  await safeApplyColumnChanges(context, {
    products: [
      {
        name: 'tax_code',
        field: {
          type: DataTypes.STRING(20),
          allowNull: true,
        },
      },
    ],
  });
};

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