import { DataTypes } from 'sequelize';

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

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

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