mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 07:22:53 +00:00
Muluhabt ERP modules
This commit is contained in:
22
infrastructure/docker/initdb/01-schemas.sql
Normal file
22
infrastructure/docker/initdb/01-schemas.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
-- Bootstrap for the single, schema-separated platform database.
|
||||
--
|
||||
-- Runs once, on an empty data volume (postgres image initdb hook). Every app owns
|
||||
-- exactly one schema and applies its own migrations into it; nothing here creates
|
||||
-- tables. Ownership map:
|
||||
--
|
||||
-- iam edr-freight-api (`pnpm iam:migration:run`, ships with @tria-plc/iamapi-common)
|
||||
-- -> history in iam.typeorm_migrations
|
||||
-- freight edr-freight-api -> history in freight.migrations
|
||||
-- passenger edr-passenger-api (Prisma) -> history in passenger._prisma_migrations
|
||||
-- edr_payment edr-payment-api -> its own TypeORM history
|
||||
-- audit @tria-plc/auditlog consumer
|
||||
--
|
||||
-- Cross-schema references stay SOFT (plain UUID columns + denormalized display
|
||||
-- fields). Co-location makes hard FKs possible; the platform deliberately does not
|
||||
-- use them, so IAM stays independently deployable and the audit trail outlives a
|
||||
-- deleted user.
|
||||
CREATE SCHEMA IF NOT EXISTS iam;
|
||||
CREATE SCHEMA IF NOT EXISTS freight;
|
||||
CREATE SCHEMA IF NOT EXISTS passenger;
|
||||
CREATE SCHEMA IF NOT EXISTS edr_payment;
|
||||
CREATE SCHEMA IF NOT EXISTS audit;
|
||||
Reference in New Issue
Block a user