core: sync connections (#6345)

* core: sync subsbriptions

* sha map

* sync event

* should delete flag

* wip

* schema

* wip

* delete

* update simplexmq

* plans

* rename, adapt

* update

* plans

* option to show ids

* plans

* fix, test

* more tests

* postgres

* plans

* cleanup

* plans

---------

Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
This commit is contained in:
spaced4ndy
2025-10-10 06:27:50 +00:00
committed by GitHub
parent 65e215509b
commit 37c8aca3b3
19 changed files with 478 additions and 12 deletions
@@ -390,6 +390,25 @@ ALTER TABLE test_chat_schema.connections ALTER COLUMN connection_id ADD GENERATE
CREATE TABLE test_chat_schema.connections_sync (
connections_sync_id bigint NOT NULL,
should_sync smallint DEFAULT 0 NOT NULL,
last_sync_ts timestamp with time zone
);
ALTER TABLE test_chat_schema.connections_sync ALTER COLUMN connections_sync_id ADD GENERATED BY DEFAULT AS IDENTITY (
SEQUENCE NAME test_chat_schema.connections_sync_connections_sync_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
CREATE TABLE test_chat_schema.contact_profiles (
contact_profile_id bigint NOT NULL,
display_name text NOT NULL,
@@ -1358,6 +1377,11 @@ ALTER TABLE ONLY test_chat_schema.connections
ALTER TABLE ONLY test_chat_schema.connections_sync
ADD CONSTRAINT connections_sync_pkey PRIMARY KEY (connections_sync_id);
ALTER TABLE ONLY test_chat_schema.contact_profiles
ADD CONSTRAINT contact_profiles_pkey PRIMARY KEY (contact_profile_id);