Files
stirling-tools--stirling-pdf/testing/compose/payg/saas-init.sql
T
wehub-resource-sync bf122cd71b
AI Engine CI / engine (push) Failing after 0s
Check generated models / generated-models (push) Failing after 1s
Enterprise E2E (Playwright) / pick (push) Failing after 8s
Enterprise E2E (Playwright) / playwright-e2e-enterprise (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:59:14 +08:00

26 lines
1.3 KiB
SQL

-- Bootstrap minimal stirling_pdf state for PAYG cucumber tests.
--
-- Runs once when the postgres-saas container is first created (loaded via
-- /docker-entrypoint-initdb.d on the official postgres image). Flyway then
-- migrates V1-V13 on backend startup, which fills in the schema; this file
-- only seeds the data rows the cucumber scenarios reference by name.
--
-- Idempotent — if the container is re-created, this whole file runs again
-- but every INSERT is guarded against duplicates.
CREATE SCHEMA IF NOT EXISTS stirling_pdf;
-- Note: the actual seed of teams / users / payg_team_extensions / wallet_policy
-- happens AFTER Flyway migrations have applied. We can't insert here because
-- the tables don't exist yet at container-init time. Instead we register a
-- helper function the backend invokes once at startup (or the cucumber
-- harness invokes via psql before running scenarios).
--
-- For "make a start", the simplest approach is to keep this file as the
-- schema bootstrap, and put the seed inserts in a separate sidecar SQL that
-- the cucumber test.sh harness pipes through psql AFTER waiting for backend
-- health. See testing/compose/payg/saas-seed.sql below.
-- Reserved for future container-init-time schema bootstrap if we ever need it.
SELECT 1;