Fix migrations and cleanup old db file
Some checks failed
/ docker-build-push (push) Failing after 6s
/ go-test (push) Successful in 54s

This commit is contained in:
Melora Hugues 2024-10-27 16:20:31 +01:00
parent d323d21c19
commit 792300ab9e
7 changed files with 11 additions and 12 deletions

Binary file not shown.

View file

@ -3,3 +3,4 @@ DROP TABLE "auth_request";
DROP TABLE "user";
DROP TABLE "backend";
DROP TABLE "client";
DROP TABLE "refresh_token";

View file

@ -44,6 +44,7 @@ CREATE TABLE "auth_request" (
code_challenge_method STRING NOT NULL DEFAULT '',
auth_time timestamp,
user_id TEXT NOT NULL DEFAULT '',
consent INTEGER NOT NULL DEFAULT 0,
FOREIGN KEY(backend_id) REFERENCES backend(id),
FOREIGN KEY(client_id) REFERENCES client(id),
FOREIGN KEY(user_id) REFERENCES user(id)
@ -56,3 +57,12 @@ CREATE TABLE "auth_code" (
FOREIGN KEY(auth_request_id) REFERENCES auth_request(id)
);
CREATE TABLE refresh_token (
id TEXT NOT NULL PRIMARY KEY,
client_id TEXT NOT NULL,
user_id TEXT NOT NULL,
scopes blob NOT NULL, -- list of strings, json-encoded
auth_time timestamp NOT NULL,
FOREIGN KEY(client_id) REFERENCES client(id),
FOREIGN KEY(user_id) REFERENCES user(id)
);

View file

@ -1 +0,0 @@
DROP TABLE refresh_token;

View file

@ -1,9 +0,0 @@
CREATE TABLE refresh_token (
id TEXT NOT NULL PRIMARY KEY,
client_id TEXT NOT NULL,
user_id TEXT NOT NULL,
scopes blob NOT NULL, -- list of strings, json-encoded
auth_time timestamp NOT NULL,
FOREIGN KEY(client_id) REFERENCES client(id),
FOREIGN KEY(user_id) REFERENCES user(id)
);

View file

@ -1 +0,0 @@
ALTER TABLE "auth_request" DROP COLUMN consent;

View file

@ -1 +0,0 @@
ALTER TABLE "auth_request" ADD COLUMN consent INTEGER NOT NULL DEFAULT 0;