caterium-app/ops/supabase-selfhosted/volumes/db/init/00-cron-and-roles.sql
pavlov346346 88b7f55db4 Ops: add self-hosted Supabase stack for Timeweb Cloud migration
Full production-ready docker-compose stack (db, kong, auth, rest,
realtime, storage, imgproxy, meta, functions, studio) targeting
api.caterium.ru, plus bootstrap script for a fresh Cloud Server,
Caddy reverse-proxy config (HTTPS, WebSocket, upload limits), and
dump/restore/verify/storage-sync scripts for moving off the managed
Supabase project (cksuehzcimitsxmeloes). Does not touch public/ or
any live runtime behavior — frontend cutover is documented separately
in frontend-cutover.md and only applied after Etap 8 verification.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 16:20:45 +03:00

15 lines
761 B
SQL

-- Runs once on first Postgres container boot (docker-entrypoint-initdb.d).
-- Mirrors what a managed Supabase project already has, so schema.sql/data.sql restore
-- cleanly on top of it. Safe to re-run (IF NOT EXISTS everywhere).
create extension if not exists pg_cron;
create extension if not exists pgcrypto;
create extension if not exists pg_stat_statements;
create extension if not exists "uuid-ossp";
-- pg_cron runs jobs as the calling user against the "postgres" database by default;
-- Caterium's cron jobs (Etap 7) are re-created by data.sql / schema.sql restore, this
-- just guarantees the extension + background worker exist before that runs.
grant usage on schema cron to postgres;
grant all privileges on all tables in schema cron to postgres;