RunCommandLogs: add a uuid to each log entry

This commit is contained in:
Graham Christensen
2022-01-24 11:37:42 -05:00
committed by Cole Helbling
parent 3ae4b19d12
commit cf49a05ff5
3 changed files with 34 additions and 3 deletions

6
src/sql/upgrade-81.sql Normal file
View File

@@ -0,0 +1,6 @@
alter table runcommandlogs add column uuid uuid;
update runcommandlogs set uuid = gen_random_uuid() where uuid is null;
alter table runcommandlogs alter column uuid set not null;
alter table runcommandlogs add constraint RunCommandLogs_uuid_unique unique(uuid);
# the unique uuid constraint adds a unique, btree index, so we don't need to create out own:
# "runcommandlogs_uuid_unique" UNIQUE CONSTRAINT, btree (uuid)