-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix h2 schema and syntax for migrations 17 and 18
- Loading branch information
1 parent
3783445
commit d36beec
Showing
2 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
16 changes: 8 additions & 8 deletions
16
src/server/src/main/resources/db/h2/V17_0_0__multi_instance.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 |
---|---|---|
@@ -1,29 +1,29 @@ | ||
-- H2-compatible version of multi-instance reaper Postgres DDL | ||
-- CHANGES: | ||
-- "node" TEXT --> "node" VARCHAR(255) because H2 doesn't support index on TEXT | ||
-- node VARCHAR --> node VARCHAR(255) because H2 doesn't support index on VARCHAR | ||
|
||
CREATE TABLE IF NOT EXISTS leader ( | ||
leader_id BIGINT PRIMARY KEY, | ||
reaper_instance_id BIGINT, | ||
reaper_instance_host TEXT, | ||
reaper_instance_host VARCHAR, | ||
last_heartbeat TIMESTAMP WITH TIME ZONE | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS running_reapers ( | ||
reaper_instance_id BIGINT PRIMARY KEY, | ||
reaper_instance_host TEXT, | ||
reaper_instance_host VARCHAR, | ||
last_heartbeat TIMESTAMP WITH TIME ZONE | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS node_metrics_v1 ( | ||
time_partition BIGINT, | ||
run_id BIGINT, | ||
node VARCHAR(255), | ||
cluster TEXT, | ||
datacenter TEXT, | ||
ts TIMESTAMP WITH TIME ZONE, | ||
node VARCHAR, | ||
cluster VARCHAR, | ||
datacenter VARCHAR, | ||
requested BOOLEAN, | ||
pending_compactions INT, | ||
has_repair_running BOOLEAN, | ||
active_anticompactions INT, | ||
PRIMARY KEY(run_id, time_partition, node) | ||
PRIMARY KEY (run_id, ts, node) | ||
); |
34 changes: 34 additions & 0 deletions
34
src/server/src/main/resources/db/h2/V18_0_0__sidecar_mode.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,34 @@ | ||
CREATE TABLE IF NOT EXISTS node_metrics_v2_source_nodes ( | ||
source_node_id SERIAL UNIQUE, | ||
cluster VARCHAR, | ||
host VARCHAR, | ||
last_updated TIMESTAMP WITH TIME ZONE, | ||
PRIMARY KEY (cluster, host) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS node_metrics_v2_metric_types ( | ||
metric_type_id SERIAL UNIQUE, | ||
metric_domain VARCHAR, | ||
metric_type VARCHAR, | ||
metric_scope VARCHAR, | ||
metric_name VARCHAR, | ||
metric_attribute VARCHAR, | ||
PRIMARY KEY (metric_domain, metric_type, metric_scope, metric_name, metric_attribute) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS node_metrics_v2 ( | ||
metric_type_id INT, | ||
source_node_id INT, | ||
ts TIMESTAMP WITH TIME ZONE, | ||
value DOUBLE PRECISION, | ||
PRIMARY KEY (metric_type_id, source_node_id, ts) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS node_operations ( | ||
cluster VARCHAR, | ||
type VARCHAR, | ||
host VARCHAR, | ||
ts TIMESTAMP WITH TIME ZONE, | ||
data VARCHAR, | ||
PRIMARY KEY (cluster, type, host, ts) | ||
); |