import type { Knex } from 'knex';

/**
 * SEO Phase 12: optional label facts for vet and agro products (stored as brands, see contract Q3).
 * Shown on /vet/brand/… and /agro/brand/… only when filled in; nothing is generated.
 * - withdrawal_period (vet): e.g. "Meat 28 days, milk 7 days"
 * - target_pest (agro): pests or diseases it controls
 * - dose_rate (agro, also vet if useful): dose per acre / per litre
 * Target species / crops already come from catalogue tags.
 */
export async function up(knex: Knex): Promise<void> {
  await knex.schema.alterTable('brands', (t) => {
    t.string('withdrawal_period', 200).nullable();
    t.string('target_pest', 300).nullable();
    t.string('dose_rate', 300).nullable();
  });
}

export async function down(knex: Knex): Promise<void> {
  await knex.schema.alterTable('brands', (t) => {
    t.dropColumn('withdrawal_period');
    t.dropColumn('target_pest');
    t.dropColumn('dose_rate');
  });
}
