There was an error while loading. Please reload this page.
(target, benchmark_set, is_active)
1 parent d5ab083 commit 4efc625Copy full SHA for 4efc625
1 file changed
database/src/pool/postgres.rs
@@ -305,11 +305,16 @@ static MIGRATIONS: &[&str] = &[
305
CREATE TABLE IF NOT EXISTS collector_config (
306
id SERIAL PRIMARY KEY,
307
target TEXT NOT NULL,
308
- name TEXT NOT NULL,
+ name TEXT NOT NULL UNIQUE,
309
date_added TIMESTAMPTZ DEFAULT NOW() NOT NULL,
310
last_heartbeat_at TIMESTAMPTZ,
311
benchmark_set INTEGER NOT NULL,
312
- is_active BOOLEAN DEFAULT FALSE NOT NULL
+ is_active BOOLEAN DEFAULT FALSE NOT NULL,
313
+
314
+ -- Given the current setup, we do not want 2 collectors that are active
315
+ -- with the same target using the same benchmark set.
316
+ CONSTRAINT collector_config_target_bench_active_uniq
317
+ UNIQUE (target, benchmark_set, is_active)
318
);
319
"#,
320
];
0 commit comments