Skip to content

Commit 2e7ced8

Browse files
committed
PR Feedback; update index and schmea.md
1 parent 055650d commit 2e7ced8

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

database/schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ whether it is active and when it last had activity denoted by `last_heartbeat_at
304304
Columns:
305305

306306
* **id** (`id`): A unique identifier for the collector.
307-
* **target** (`text NOT NULL`): The ISA of the collector for example; `AArch64`.
307+
* **target** (`text NOT NULL`): The ISA of the collector for example; `aarch64-unknown-linux-gnu`.
308308
* **name** (`text NOT NULL`): Unique name for the collector.
309309
* **date_added** (`timestamptz NOT NULL`): When the collector was added
310310
* **last_heartbeat_at** (`timestamptz`): When the collector last updated this

database/src/pool/postgres.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,12 @@ static MIGRATIONS: &[&str] = &[
317317
date_added TIMESTAMPTZ DEFAULT NOW() NOT NULL,
318318
last_heartbeat_at TIMESTAMPTZ,
319319
benchmark_set INTEGER NOT NULL,
320-
is_active BOOLEAN DEFAULT FALSE NOT NULL,
321-
322-
-- Given the current setup, we do not want 2 collectors that are active
323-
-- with the same target using the same benchmark set.
324-
CONSTRAINT collector_config_target_bench_active_uniq
325-
UNIQUE (target, benchmark_set, is_active)
320+
is_active BOOLEAN DEFAULT FALSE NOT NULL
326321
);
322+
-- Given the current setup, we do not want 2 collectors that are active
323+
-- with the same target using the same benchmark set.
324+
CREATE UNIQUE INDEX collector_config_target_bench_active_uniq ON collector_config
325+
(target, benchmark_set, is_active) WHERE is_active = TRUE;
327326
"#,
328327
];
329328

0 commit comments

Comments
 (0)