From ef53cb079d80c194911493963fc92df5d9f5611e Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Sun, 3 Nov 2024 22:32:57 -0600 Subject: [PATCH] add setup.sql Signed-off-by: eternal-flame-AD --- sql/setup.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sql/setup.sql diff --git a/sql/setup.sql b/sql/setup.sql new file mode 100644 index 0000000..ac757ec --- /dev/null +++ b/sql/setup.sql @@ -0,0 +1,18 @@ +ALTER SYSTEM SET wal_level = logical; + +-- restart the server + +CREATE ROLE subscriber LOGIN REPLICATION PASSWORD 'subscriber'; + +CREATE PUBLICATION mi_publication + FOR TABLES IN SCHEMA public + WITH (publish = 'insert, update, delete'); + +-- on the subscriber side + +--- Precondition: schema and data prior to starting the publication present + +CREATE SUBSCRIPTION mi_subscription + CONNECTION 'postgresql://subscriber:subscriber@localhost:5432/misskey' + PUBLICATION mi_publication; +