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 d3277e0 commit befcbe8Copy full SHA for befcbe8
database/src/pool/postgres.rs
@@ -289,11 +289,16 @@ static MIGRATIONS: &[&str] = &[
289
CREATE TABLE IF NOT EXISTS collector_config (
290
id SERIAL PRIMARY KEY,
291
target TEXT NOT NULL,
292
- name TEXT NOT NULL,
+ name TEXT NOT NULL UNIQUE,
293
date_added TIMESTAMPTZ DEFAULT NOW() NOT NULL,
294
last_heartbeat_at TIMESTAMPTZ,
295
benchmark_set INTEGER NOT NULL,
296
- is_active BOOLEAN DEFAULT FALSE NOT NULL
+ is_active BOOLEAN DEFAULT FALSE NOT NULL,
297
+
298
+ -- Given the current setup, we do not want 2 collectors that are active
299
+ -- with the same target using the same benchmark set.
300
+ CONSTRAINT collector_config_target_bench_active_uniq
301
+ UNIQUE (target, benchmark_set, is_active)
302
);
303
"#,
304
];
0 commit comments