We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
(target, benchmark_set, is_active)
1 parent 23a7b02 commit adc0417Copy full SHA for adc0417
database/src/pool/postgres.rs
@@ -310,11 +310,16 @@ static MIGRATIONS: &[&str] = &[
310
CREATE TABLE IF NOT EXISTS collector_config (
311
id SERIAL PRIMARY KEY,
312
target TEXT NOT NULL,
313
- name TEXT NOT NULL,
+ name TEXT NOT NULL UNIQUE,
314
date_added TIMESTAMPTZ DEFAULT NOW() NOT NULL,
315
last_heartbeat_at TIMESTAMPTZ,
316
benchmark_set INTEGER NOT NULL,
317
- is_active BOOLEAN DEFAULT FALSE NOT NULL
+ is_active BOOLEAN DEFAULT FALSE NOT NULL,
318
+
319
+ -- Given the current setup, we do not want 2 collectors that are active
320
+ -- with the same target using the same benchmark set.
321
+ CONSTRAINT collector_config_target_bench_active_uniq
322
+ UNIQUE (target, benchmark_set, is_active)
323
);
324
"#,
325
];
0 commit comments