fix: db migration for multiple callback urls

This commit is contained in:
Elias Schneider
2024-08-24 01:12:33 +02:00
parent e45b0b3ed0
commit 552d7ccfa5
2 changed files with 10 additions and 13 deletions

View File

@@ -1,7 +1,6 @@
create table oidc_clients create table oidc_clients
( (
id TEXT not null id TEXT not null primary key,
primary key,
created_at DATETIME, created_at DATETIME,
name TEXT, name TEXT,
secret TEXT, secret TEXT,
@@ -12,14 +11,13 @@ create table oidc_clients
); );
insert into oidc_clients(id, created_at, name, secret, callback_url, image_type, created_by_id) insert into oidc_clients(id, created_at, name, secret, callback_url, image_type, created_by_id)
select select id,
id, created_at,
created_at, name,
name, secret,
secret, json_extract(callback_urls, '$[0]'),
json_extract(callback_urls, '$[0]'), image_type,
image_type, created_by_id
created_by_id
from oidc_clients_dg_tmp; from oidc_clients_dg_tmp;
drop table oidc_clients_dg_tmp; drop table oidc_clients_dg_tmp;

View File

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