diff --git a/polyculeconnect.db b/polyculeconnect.db deleted file mode 100644 index 5b1a7bd..0000000 Binary files a/polyculeconnect.db and /dev/null differ diff --git a/polyculeconnect/migrations/0_initial_schema.down.sql b/polyculeconnect/migrations/0_initial_schema.down.sql index aa0b196..d5d2493 100644 --- a/polyculeconnect/migrations/0_initial_schema.down.sql +++ b/polyculeconnect/migrations/0_initial_schema.down.sql @@ -3,3 +3,4 @@ DROP TABLE "auth_request"; DROP TABLE "user"; DROP TABLE "backend"; DROP TABLE "client"; +DROP TABLE "refresh_token"; diff --git a/polyculeconnect/migrations/0_initial_schema.up.sql b/polyculeconnect/migrations/0_initial_schema.up.sql index a699c06..96afd37 100644 --- a/polyculeconnect/migrations/0_initial_schema.up.sql +++ b/polyculeconnect/migrations/0_initial_schema.up.sql @@ -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) +); diff --git a/polyculeconnect/migrations/1_tokens.down.sql b/polyculeconnect/migrations/1_tokens.down.sql deleted file mode 100644 index 3e12ff9..0000000 --- a/polyculeconnect/migrations/1_tokens.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE refresh_token; diff --git a/polyculeconnect/migrations/1_tokens.up.sql b/polyculeconnect/migrations/1_tokens.up.sql deleted file mode 100644 index 818e48d..0000000 --- a/polyculeconnect/migrations/1_tokens.up.sql +++ /dev/null @@ -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) -); diff --git a/polyculeconnect/migrations/2_consent.down.sql b/polyculeconnect/migrations/2_consent.down.sql deleted file mode 100644 index f4fac91..0000000 --- a/polyculeconnect/migrations/2_consent.down.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "auth_request" DROP COLUMN consent; diff --git a/polyculeconnect/migrations/2_consent.up.sql b/polyculeconnect/migrations/2_consent.up.sql deleted file mode 100644 index ccfe5b2..0000000 --- a/polyculeconnect/migrations/2_consent.up.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "auth_request" ADD COLUMN consent INTEGER NOT NULL DEFAULT 0; \ No newline at end of file