import { MigrationInterface, QueryRunner } from 'typeorm';

/**
 * Terms & Conditions per destination (client 2026-10-23) — replaces the
 * single tenant-wide text in General Settings. Nullable, no backfill:
 * tenant_settings.terms_and_conditions was empty on prod.
 */
export class DestinationTerms1788700000000 implements MigrationInterface {
  name = 'DestinationTerms1788700000000';

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "destinations" ADD COLUMN IF NOT EXISTS "terms_and_conditions" text`,
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "destinations" DROP COLUMN IF EXISTS "terms_and_conditions"`,
    );
  }
}
