Skip to content

Commit

Permalink
Add migrations for shards table in postgres metastore
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalesh0406 committed Nov 14, 2023
1 parent 1d6753b commit 20bf828
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP TABLE shards;

DROP TYPE IF EXISTS SHARD_STATE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TYPE SHARD_STATE AS ENUM ('unspecified', 'open', 'unavailable', 'closed');

CREATE TABLE IF NOT EXISTS shards (
index_uid VARCHAR(282) NOT NULL,
source_id VARCHAR(255) NOT NULL,
shard_id BIGSERIAL,
leader_id VARCHAR(255) NOT NULL,
follower_id VARCHAR(255),
shard_state SHARD_STATE NOT NULL,
publish_position_inclusive bytea NOT NULL,
publish_token VARCHAR(255),
PRIMARY KEY (index_uid, source_id, shard_id),
FOREIGN KEY (index_uid) REFERENCES indexes (index_uid)
);

0 comments on commit 20bf828

Please sign in to comment.