import { DataTypes } from 'sequelize';

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

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

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