-- Canonical Party: operational data store schema (runs on the postgres service). -- -- The product owns one PostgreSQL schema. pg_graphql reflects only the schemas on the -- search_path, and the product's RPC endpoint (030_api.sql) sets the search_path to this -- schema, so this is what scopes the GraphQL API to the product. CREATE SCHEMA canonical_party; COMMENT ON SCHEMA canonical_party IS E'@graphql({"inflect_names": true, "introspection": true, "max_rows": 100})'; -- Maintains updated_at on every row change. Used by all product tables (020_tables.sql). -- updated_at is the freshness signal carried on the outbound topics and into the lake. CREATE FUNCTION canonical_party.set_updated_at() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN NEW.updated_at := now(); RETURN NEW; END $$;