-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migrations for shards table in postgres metastore (#4119)
- Loading branch information
1 parent
26350df
commit 749c170
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
quickwit/quickwit-metastore/migrations/postgresql/12_create-shards.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DROP TABLE shards; | ||
|
||
DROP TYPE IF EXISTS SHARD_STATE; |
14 changes: 14 additions & 0 deletions
14
quickwit/quickwit-metastore/migrations/postgresql/12_create-shards.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 VARCHAR(255) NOT NULL, | ||
publish_token VARCHAR(255), | ||
PRIMARY KEY (index_uid, source_id, shard_id), | ||
FOREIGN KEY (index_uid) REFERENCES indexes (index_uid) | ||
); |