graphql-engine/server/src-rsr/migrations/44_to_45.sql
Lyndon Maydwell c737ce992d Schema-Sync Improvements for Cloud, Pro, and OSS - Version Checking for Metadata (#738)
Modifying schema-sync implementation to use polling for OSS/Pro. Invalidations are now propagated via the `hdb_catalog.hdb_schema_notifications` table in OSS/Pro. Pattern followed is now a Listener/Processor split with Cloud listening for changes via a LISTEN/NOTIFY channel and OSS polling for resource version changes in the metadata table. See issue #460 for more details.

GitOrigin-RevId: 48434426df02e006f4ec328c0d5cd5b30183db25
2021-04-06 03:25:53 +00:00

13 lines
441 B
SQL

-- This migration adds the schema notification table
--
-- NOTE: In OSS this table only contains a single row (indicated by ID 1).
-- This may change to allow multiple notifications in future.
CREATE TABLE hdb_catalog.hdb_schema_notifications
(
id INTEGER PRIMARY KEY CHECK (id = 1),
notification JSON NOT NULL,
resource_version INTEGER NOT NULL DEFAULT 1,
instance_id UUID NOT NULL,
updated_at TIMESTAMPTZ DEFAULT NOW()
);