Skip to content

Commit

Permalink
fix: db migration for multiple callback urls
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith404 committed Aug 23, 2024
1 parent e45b0b3 commit 552d7cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
18 changes: 8 additions & 10 deletions backend/migrations/20240820205521_multiple_callback_urls.down.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
create table oidc_clients
(
id TEXT not null
primary key,
id TEXT not null primary key,
created_at DATETIME,
name TEXT,
secret TEXT,
Expand All @@ -12,14 +11,13 @@ create table oidc_clients
);

insert into oidc_clients(id, created_at, name, secret, callback_url, image_type, created_by_id)
select
id,
created_at,
name,
secret,
json_extract(callback_urls, '$[0]'),
image_type,
created_by_id
select id,
created_at,
name,
secret,
json_extract(callback_urls, '$[0]'),
image_type,
created_by_id
from oidc_clients_dg_tmp;

drop table oidc_clients_dg_tmp;
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
create table oidc_clients_dg_tmp
(
id TEXT not null
primary key,
id TEXT not null primary key,
created_at DATETIME,
name TEXT,
secret TEXT,
Expand All @@ -16,7 +15,7 @@ select id,
created_at,
name,
secret,
CAST(json_group_array(json_quote(callback_url)) AS BLOB),
CAST('["' || callback_url || '"]' AS BLOB),
image_type,
created_by_id
from oidc_clients;
Expand Down

0 comments on commit 552d7cc

Please sign in to comment.