Add schema for timelines table

This commit is contained in:
Arpad Müller
2025-01-15 02:00:49 +01:00
parent c60b91369a
commit 7d296b3cea
3 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1 @@
DROP TABLE timelines;

View File

@@ -0,0 +1,10 @@
CREATE TABLE timelines (
tenant_id VARCHAR NOT NULL,
timeline_id VARCHAR NOT NULL,
PRIMARY KEY(tenant_id, timeline_id),
generation INTEGER NOT NULL,
sk_set BIGINT[] NOT NULL,
new_sk_set BIGINT[] NOT NULL,
cplane_notified_generation INTEGER NOT NULL,
status VARCHAR NOT NULL
);

View File

@@ -58,10 +58,23 @@ diesel::table! {
}
}
diesel::table! {
timelines (tenant_id, timeline_id) {
tenant_id -> Varchar,
timeline_id -> Varchar,
generation -> Int4,
sk_set -> Array<Nullable<Int8>>,
new_sk_set -> Array<Nullable<Int8>>,
cplane_notified_generation -> Int4,
status -> Varchar,
}
}
diesel::allow_tables_to_appear_in_same_query!(
controllers,
metadata_health,
nodes,
safekeepers,
tenant_shards,
timelines,
);