From 792300ab9eb573ca3f3fb304e80dba8e3a60b470 Mon Sep 17 00:00:00 2001 From: Melora Hugues Date: Sun, 27 Oct 2024 16:20:31 +0100 Subject: [PATCH] Fix migrations and cleanup old db file --- polyculeconnect.db | Bin 98304 -> 0 bytes .../migrations/0_initial_schema.down.sql | 1 + .../migrations/0_initial_schema.up.sql | 10 ++++++++++ polyculeconnect/migrations/1_tokens.down.sql | 1 - polyculeconnect/migrations/1_tokens.up.sql | 9 --------- polyculeconnect/migrations/2_consent.down.sql | 1 - polyculeconnect/migrations/2_consent.up.sql | 1 - 7 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 polyculeconnect.db delete mode 100644 polyculeconnect/migrations/1_tokens.down.sql delete mode 100644 polyculeconnect/migrations/1_tokens.up.sql delete mode 100644 polyculeconnect/migrations/2_consent.down.sql delete mode 100644 polyculeconnect/migrations/2_consent.up.sql diff --git a/polyculeconnect.db b/polyculeconnect.db deleted file mode 100644 index 5b1a7bd14883b4779373e7767555331a9ff12e27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 98304 zcmeI(?Qh%09S3mH527Vmmh<4UE?}4jVknyJ)k;=mZBV3+;TLV58plPKy&-7nBr~B% z`bar8uotsu4?{K#Xo0@iyAJ4!Vtuv0pxBGO+lvlE{(!yMAF#eHFzoI~NhC!IYTyB> z_BAYv$0H@)=YDs*<0X$C-Zea;Hf-9`J@tBKHX})y_f$2L$xO4?>+IF}d4p|CbQ0`c z3T>xtPG^4nMd8zek@+f5a-Zi~g)4@gjAJNo} zma7e7?j2$2t-ep;l~nT&AuZi7|UZD;sG`loiQ zH!j=@m{|4m^Hx<+iO~yJ>!hK#O;0VCSs+lNd!(+h*5?^5;(B_^>0Wm4$o2L0>YDgf z*Vo?>zv@Rjo9qKj-SxOJi{qC%KLB=EG!aVKmGJuNuZ`ZNlq+X+LROZSrQeoCyy|Ul zPoreN&96SRJsFACaL)MzD{F?1ZMj7Aj=pcuCdauN{0xkDMr2S{)mobx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`E75`EE)ATpfpA`O9_(T2|`CC(;<^D5ZMvg29 zKmY;|fB*y_a9#o@jmzR;_gP7dgX-kKU{7nsvySk#5*Z7HbAsVyu#1m?qa()tr`~*m z)pnyt`47PSM=bnlzn@N>Yx~*aaZoU1PIw};n(sXE?z}s;X|iX_9--_>bl>RBe~2Z< z@aO*=v~pu^&|Dxas#U|O*I7+Z@!Gz5DXToFq|FI}Q@YcMX!`QW8y97zQjvaThpRa_ zI(qD-q^j;HhgNfjsp{a9`w#6r@EoxI;m=msx>j!%;-B>r4{lQfNlXQ*7Y5DjdaF&< z?&ihg+q2@a-^n9?&ed6w>K<_+qS)O%^yG^#`Xn`xw3!ZDC$rmpp@l71@O8kXbJ
  • @O?cagAM%qlnM(qPzHhO1Ti-M5=AwMnWbh=JS7XjKnigC7>#nhM7lT$~3x4+Q6SkZbKSyIT z>-g%Ts&>{vLg!fQL4ZbC2g2vc3H_~zsW%H*Wpg2o&e2`>nN90jwX-#SyqcGlg$3!v zpNMz%cisyT%Ff<^GhwBq|8}#d_pKlcfU){RFl|cXk5P$##AOHafKmY;|fB*!} GOW?m)Mc4rV 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