Skip to content

Commit

Permalink
fix: migrations should not be breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Sep 12, 2023
1 parent 6bc85b2 commit b51ef7b
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
ALTER TABLE hydra_client DROP CONSTRAINT hydra_client_pkey;

ALTER TABLE hydra_client ADD COLUMN pk UUID NOT NULL DEFAULT gen_random_uuid();

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

ALTER TABLE hydra_client DROP COLUMN pk;
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ SELECT id,
subject_type,
allowed_cors_origins,
id,
pk,
pk_deprecated,
audience,
created_at,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +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_deprecated INTEGER NULL DEFAULT NULL,
audience TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
Expand Down Expand Up @@ -75,6 +76,7 @@ INSERT INTO "_hydra_client_tmp" (id,
userinfo_signed_response_alg,
subject_type,
allowed_cors_origins,
pk,
pk_deprecated,
audience,
created_at,
Expand Down Expand Up @@ -124,6 +126,7 @@ SELECT id,
userinfo_signed_response_alg,
subject_type,
allowed_cors_origins,
pk,
pk_deprecated,
audience,
created_at,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
ALTER TABLE hydra_client DROP CONSTRAINT hydra_client_pkey;

ALTER TABLE hydra_client DROP COLUMN pk;

ALTER TABLE hydra_client ADD PRIMARY KEY (id, nid);

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit b51ef7b

Please sign in to comment.