There was an error while loading. Please reload this page.
(target, benchmark_set, is_active)
1 parent ef42ae2 commit e8b9121Copy full SHA for e8b9121
1 file changed
database/src/pool/postgres.rs
@@ -313,11 +313,16 @@ static MIGRATIONS: &[&str] = &[
313
CREATE TABLE IF NOT EXISTS collector_config (
314
id SERIAL PRIMARY KEY,
315
target TEXT NOT NULL,
316
- name TEXT NOT NULL,
+ name TEXT NOT NULL UNIQUE,
317
date_added TIMESTAMPTZ DEFAULT NOW() NOT NULL,
318
last_heartbeat_at TIMESTAMPTZ,
319
benchmark_set INTEGER NOT NULL,
320
- is_active BOOLEAN DEFAULT FALSE NOT NULL
+ 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)
326
);
327
"#,
328
];
0 commit comments