Files
ubicloud/migrate/postgres_monitor_db.sql
Burak Yucesoy 6519e5ba78 Use Ubicloud managed PostgreSQL for lsn recording
This data is not very critical because it is refreshed every few seconds. Also
it is already stored an unlogged table. All in al, this looks like a great
opportunity for dogfooding.

To keep development and test simple (i.e. not require another database setup),
I made default value for the new config as Config.clover_database_url. I'm also
not adding a migration to drop existing postgres_lsn_monitor table. In this way
we can continue to use existing database without doing any extra setup in the
development environment.

Also isn't it cool that Sequel is able to use models stored in different
databases and even use associations with them.
2024-02-21 10:54:31 +01:00

8 lines
244 B
SQL

CREATE UNLOGGED TABLE public.postgres_lsn_monitor (
postgres_server_id uuid NOT NULL,
last_known_lsn pg_lsn
);
ALTER TABLE ONLY public.postgres_lsn_monitor
ADD CONSTRAINT postgres_lsn_monitor_pkey PRIMARY KEY (postgres_server_id);