Files
mercadodevida/project/migrations/035_users_preferences.js
2026-08-21 08:06:31 +02:00

16 lines
474 B
JavaScript

/**
* 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`);
};