Files
madbase/scripts/setup_default_project.sql
Vlad Durnea a66d908eff
Some checks failed
CI / podman-build (push) Has been cancelled
CI / rust (push) Has been cancelled
chore: full stack stability and migration fixes, plus react UI progress
2026-03-18 09:01:38 +02:00

27 lines
851 B
SQL

-- Setup default project with environment variables
-- This script should be run after setting up the database
-- Update existing default project or insert if not exists
INSERT INTO projects (name, jwt_secret, anon_key, service_role_key, created_at, updated_at)
VALUES (
'default',
:'JWT_SECRET',
:'MADBASE_ANON_KEY',
:'MADBASE_SERVICE_ROLE_KEY',
NOW(),
NOW()
)
ON CONFLICT (name) DO UPDATE SET
jwt_secret = EXCLUDED.jwt_secret,
anon_key = EXCLUDED.anon_key,
service_role_key = EXCLUDED.service_role_key,
updated_at = NOW();
-- Verify the update
SELECT name,
substring(jwt_secret, 1, 8) || '...' as jwt_secret_preview,
substring(anon_key, 1, 20) || '...' as anon_key_preview,
substring(service_role_key, 1, 20) || '...' as service_role_key_preview
FROM projects
WHERE name = 'default';