chore: Force license uuids to not be null (#6012)

* chore: Force license uuids to not be null

* All unit tests generate uuids for licenses

* Update migration files to new numbers

* Put migration in transaction
This commit is contained in:
Steven Masley
2023-02-13 18:21:58 -06:00
committed by GitHub
parent a54de6093b
commit 733f58c76d
11 changed files with 39 additions and 25 deletions

View File

@ -0,0 +1 @@
ALTER TABLE ONLY licenses ALTER COLUMN uuid DROP NOT NULL;

View File

@ -0,0 +1,8 @@
BEGIN;
-- We need to assign uuids to any existing licenses that don't have them.
UPDATE licenses SET uuid = gen_random_uuid() WHERE uuid IS NULL;
-- Assert no licenses have null uuids.
ALTER TABLE ONLY licenses ALTER COLUMN uuid SET NOT NULL;
COMMIT;