From 4b526538af660cf4c29988cd514b18fe673dc8a8 Mon Sep 17 00:00:00 2001 From: Todd Date: Mon, 13 Jun 2022 12:55:05 -0700 Subject: [PATCH] Make server_id in job_run type text since it is nullable. (#2177) --- .../oss/postgres/99/02_worker_controller_tables.up.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/db/schema/migrations/oss/postgres/99/02_worker_controller_tables.up.sql b/internal/db/schema/migrations/oss/postgres/99/02_worker_controller_tables.up.sql index d2cf36eb67..f2ff45a450 100644 --- a/internal/db/schema/migrations/oss/postgres/99/02_worker_controller_tables.up.sql +++ b/internal/db/schema/migrations/oss/postgres/99/02_worker_controller_tables.up.sql @@ -199,9 +199,13 @@ alter table session_connection -- Finally, neither jobs nor servers are exposed out of boundary so the risk of -- losing data that would be useful later on is diminished. alter table job_run - add column controller_id wt_private_id, + add column controller_id text, drop column server_id; alter table job_run + add constraint controller_id_must_be_at_least_10_characters + check( + length(trim(controller_id)) > 10 + ), add constraint server_controller_fkey foreign key (controller_id) references server_controller (private_id)