mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-06-12 14:30:18 +00:00
chore: init db migrations
This commit is contained in:
@@ -46,3 +46,28 @@ UPDATE "oidc_sessions" SET
|
||||
"userinfo_json" = $8
|
||||
WHERE "sub" = $9
|
||||
RETURNING *;
|
||||
|
||||
-- name: CreateOIDCConsent :one
|
||||
INSERT INTO "oidc_consent" (
|
||||
"uuid",
|
||||
"client_id",
|
||||
"scopes"
|
||||
) VALUES (
|
||||
$1, $2, $3
|
||||
)
|
||||
RETURNING *;
|
||||
|
||||
-- name: GetOIDCConsentByUUID :one
|
||||
SELECT * FROM "oidc_consent"
|
||||
WHERE "uuid" = $1;
|
||||
|
||||
-- name: UpdateOIDCConsent :one
|
||||
UPDATE "oidc_consent" SET
|
||||
"scopes" = $1,
|
||||
"updated_at" = CURRENT_TIMESTAMP
|
||||
WHERE "uuid" = $2
|
||||
RETURNING *;
|
||||
|
||||
-- name: DeleteOIDCConsentByUUID :exec
|
||||
DELETE FROM "oidc_consent"
|
||||
WHERE "uuid" = $1;
|
||||
|
||||
@@ -9,3 +9,11 @@ CREATE TABLE IF NOT EXISTS "oidc_sessions" (
|
||||
"nonce" TEXT NOT NULL DEFAULT '',
|
||||
"userinfo_json" TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "oidc_consent" (
|
||||
"uuid" TEXT NOT NULL UNIQUE PRIMARY KEY,
|
||||
"client_id" TEXT NOT NULL,
|
||||
"scopes" TEXT NOT NULL,
|
||||
"created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
@@ -46,3 +46,28 @@ UPDATE "oidc_sessions" SET
|
||||
"userinfo_json" = ?
|
||||
WHERE "sub" = ?
|
||||
RETURNING *;
|
||||
|
||||
-- name: CreateOIDCConsent :one
|
||||
INSERT INTO "oidc_consent" (
|
||||
"uuid",
|
||||
"client_id",
|
||||
"scopes"
|
||||
) VALUES (
|
||||
?, ?, ?
|
||||
)
|
||||
RETURNING *;
|
||||
|
||||
-- name: GetOIDCConsentByUUID :one
|
||||
SELECT * FROM "oidc_consent"
|
||||
WHERE "uuid" = ?;
|
||||
|
||||
-- name: UpdateOIDCConsent :one
|
||||
UPDATE "oidc_consent" SET
|
||||
"scopes" = ?,
|
||||
"updated_at" = CURRENT_TIMESTAMP
|
||||
WHERE "uuid" = ?
|
||||
RETURNING *;
|
||||
|
||||
-- name: DeleteOIDCConsentByUUID :exec
|
||||
DELETE FROM "oidc_consent"
|
||||
WHERE "uuid" = ?;
|
||||
|
||||
@@ -9,3 +9,11 @@ CREATE TABLE IF NOT EXISTS "oidc_sessions" (
|
||||
"nonce" TEXT NOT NULL DEFAULT "",
|
||||
"userinfo_json" TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "oidc_consent" (
|
||||
"uuid" TEXT NOT NULL UNIQUE PRIMARY KEY,
|
||||
"client_id" TEXT NOT NULL,
|
||||
"scopes" TEXT NOT NULL,
|
||||
"created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user