Skip to content

Commit 0d11c62

Browse files
committed
PR feedback; use INTEGER rather than UUID
1 parent 507f135 commit 0d11c62

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

database/schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,5 +268,5 @@ sqlite> SELECT * FROM collector_config;
268268
269269
id target date_added last_heartbeat_at benchmark_set is_active
270270
--------- ------------------------- ------------- ---------------- --------- -------
271-
ea1f4e... aarch64-unknown-linux-gnu 2025-06-11... 2025-06-12 17... cea1bc... 0
271+
1 aarch64-unknown-linux-gnu 2025-06-11... 2025-06-12 17... 2 0
272272
```

database/src/pool/postgres.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,14 @@ static MIGRATIONS: &[&str] = &[
306306
// Prevent multiple try commits without a `sha` and the same `pr` number
307307
// being added to the table
308308
r#"CREATE UNIQUE INDEX benchmark_request_pr_commit_type_idx ON benchmark_request (pr, commit_type) WHERE status != 'completed';"#,
309-
r#"CREATE EXTENSION IF NOT EXISTS "uuid-ossp";"#,
310309
r#"
311310
CREATE TABLE IF NOT EXISTS collector_config (
312-
id UUID PRIMARY KEY,
311+
id SERIAL PRIMARY KEY,
313312
target TEXT NOT NULL,
313+
name TEXT NOT NULL,
314314
date_added TIMESTAMPTZ DEFAULT NOW() NOT NULL,
315315
last_heartbeat_at TIMESTAMPTZ,
316-
benchmark_set UUID NOT NULL,
316+
benchmark_set INTEGER NOT NULL,
317317
is_active BOOLEAN DEFAULT FALSE NOT NULL
318318
);
319319
"#,

database/src/pool/sqlite.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,12 @@ static MIGRATIONS: &[Migration] = &[
407407
Migration::without_foreign_key_constraints(
408408
r#"
409409
CREATE TABLE IF NOT EXISTS collector_config (
410-
id TEXT PRIMARY KEY,
410+
id INTEGER AUTO INCREMENT PRIMARY KEY,
411411
target TEXT NOT NULL,
412+
name TEXT NOT NULL,
412413
date_added TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
413414
last_heartbeat_at TIMESTAMP,
414-
benchmark_set TEXT NOT NULL,
415+
benchmark_set INTEGER NOT NULL,
415416
is_active BOOLEAN DEFAULT FALSE NOT NULL
416417
);
417418
"#,

0 commit comments

Comments
 (0)