Skip to content

Commit

Permalink
fix: migration errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Sep 12, 2023
1 parent b51ef7b commit 1912181
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
UPDATE hydra_client SET pk = gen_random_uuid() WHERE pk IS NULL;

ALTER TABLE hydra_client ALTER COLUMN pk SET NOT NULL;

ALTER TABLE hydra_client DROP CONSTRAINT hydra_client_pkey;

ALTER TABLE hydra_client ADD PRIMARY KEY (pk);
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
ALTER TABLE hydra_client MODIFY pk CHAR(36) NOT NULL;

ALTER TABLE hydra_client DROP PRIMARY KEY, ADD PRIMARY KEY (pk);
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
ALTER TABLE hydra_client DROP PRIMARY KEY, ADD PRIMARY KEY (id, nid);

ALTER TABLE hydra_client MODIFY pk CHAR(36);
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CREATE TABLE "_hydra_client_tmp"
userinfo_signed_response_alg VARCHAR(10) NOT NULL DEFAULT '',
subject_type VARCHAR(15) NOT NULL DEFAULT '',
allowed_cors_origins TEXT NOT NULL,
pk TEXT NOT NULL,
pk TEXT NULL,
pk_deprecated INTEGER NULL DEFAULT NULL,
audience TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ALTER TABLE hydra_client DROP CONSTRAINT hydra_client_pkey;

ALTER TABLE hydra_client ALTER COLUMN pk DROP NOT NULL;

ALTER TABLE hydra_client ADD PRIMARY KEY (id, nid);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE hydra_client SET pk = gen_random_uuid() WHERE pk IS NULL;

ALTER TABLE hydra_client ALTER COLUMN pk SET NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE hydra_client ALTER COLUMN pk DROP NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- only for crdb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- only for crdb

0 comments on commit 1912181

Please sign in to comment.