mirror of
https://github.com/GothenburgBitFactory/taskchampion-sync-server.git
synced 2025-08-01 20:20:25 +02:00
Add taskchampion-sync-server-storage-postgres
This is built to be more robust than the SQLite storage, and to integrate with other applications. The idea is that for example a web application might interact with the same DB to create and delete clients as customers come and go.
This commit is contained in:
parent
816c9a3c80
commit
309abce339
11 changed files with 1253 additions and 8 deletions
17
postgres/schema.sql
Normal file
17
postgres/schema.sql
Normal file
|
@ -0,0 +1,17 @@
|
|||
CREATE TABLE clients (
|
||||
client_id UUID PRIMARY KEY,
|
||||
latest_version_id UUID default '00000000-0000-0000-0000-000000000000',
|
||||
snapshot_version_id UUID,
|
||||
versions_since_snapshot INTEGER,
|
||||
snapshot_timestamp BIGINT,
|
||||
snapshot BYTEA);
|
||||
|
||||
CREATE TABLE versions (
|
||||
client_id UUID NOT NULL,
|
||||
FOREIGN KEY(client_id) REFERENCES clients (client_id) ON DELETE CASCADE,
|
||||
version_id UUID NOT NULL,
|
||||
parent_version_id UUID,
|
||||
history_segment BYTEA,
|
||||
CONSTRAINT versions_pkey PRIMARY KEY (client_id, version_id)
|
||||
);
|
||||
CREATE INDEX versions_by_parent ON versions (parent_version_id);
|
Loading…
Add table
Add a link
Reference in a new issue