mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-27 20:25:41 +00:00
refactor: rework oauth name database migration
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
ALTER TABLE "sessions" ADD COLUMN "oauth_name" TEXT;
|
||||
|
||||
UPDATE
|
||||
"sessions"
|
||||
SET
|
||||
"oauth_name" = 'Generic'
|
||||
WHERE
|
||||
"oauth_name" IS NULL AND "provider" IS NOT NULL;
|
||||
UPDATE "sessions"
|
||||
SET "oauth_name" = CASE
|
||||
WHEN LOWER("provider") = 'github' THEN 'GitHub'
|
||||
WHEN LOWER("provider") = 'google' THEN 'Google'
|
||||
ELSE UPPER(SUBSTR("provider", 1, 1)) || SUBSTR("provider", 2)
|
||||
END
|
||||
WHERE "oauth_name" IS NULL AND "provider" IS NOT NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user