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

export const up: Migration = async ({ context }) => {
  await safeApplyColumnChanges(context, {
    payment_currencies: [
      {
        name: 'token_config',
        field: {
          type: DataTypes.JSON,
          allowNull: true,
        },
      },
    ],
  });
};

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