Files
weeding/supabase/migrations/20251230_add_master_otp.sql

13 lines
501 B
SQL

-- Enable pgcrypto extension for hashing
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
-- Add master_code_hash column to profiles
ALTER TABLE public.profiles ADD COLUMN IF NOT EXISTS master_code_hash TEXT;
-- Set a default master code for Kenan Karaer (or all admins)
-- The hash below is for '123456' using bcrypt
-- You can generate new hashes using: select crypt('YOUR_CODE', gen_salt('bf'));
UPDATE public.profiles
SET master_code_hash = crypt('271210220792', gen_salt('bf'))
WHERE role = 'admin';