/**
 * Adds a JSONB preferences column to users_profiles so customers can manage
 * notification/marketing preferences from their account page.
 * @param {import('node-pg-migrate').MigrationBuilder} pgm
 */
export const up = (pgm) => {
  pgm.sql(`
    ALTER TABLE users_profiles
    ADD COLUMN IF NOT EXISTS preferences jsonb NOT NULL DEFAULT '{}'::jsonb
  `);
};

export const down = (pgm) => {
  pgm.sql(`ALTER TABLE users_profiles DROP COLUMN IF EXISTS preferences`);
};
