Migrations

This commit is contained in:
2026-03-08 16:58:05 +08:00
parent d87b5e73d7
commit ce82a88e04
19 changed files with 1526 additions and 0 deletions
@@ -0,0 +1,15 @@
-- Add religion column to profiles with PH-common defaults
ALTER TABLE profiles ADD COLUMN IF NOT EXISTS religion text NOT NULL DEFAULT 'catholic';
-- Add tracking consent column
ALTER TABLE profiles ADD COLUMN IF NOT EXISTS allow_tracking boolean NOT NULL DEFAULT false;
-- Seed Ramadan mode setting
INSERT INTO app_settings (key, value)
VALUES ('ramadan_mode', '{"enabled": false, "auto_detect": true}'::jsonb)
ON CONFLICT (key) DO NOTHING;
-- RLS: all authenticated users can read religion; users can update their own;
-- admins can update anyone's religion.
-- (Existing profile RLS already allows select; we only need to ensure update
-- policies cover the new columns.)