From 1346223822a84f183f3c024845f3a7e2afec2251 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Wed, 26 Oct 2022 14:36:43 +0200 Subject: [PATCH] Reshuffle schema versions after rebase --- lib/db.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/db.py b/lib/db.py index 4fee972..da9c837 100644 --- a/lib/db.py +++ b/lib/db.py @@ -161,18 +161,18 @@ class DB: "UPDATE scheme SET version=12", ) schemes[13] = ( - """DROP TABLE IF EXISTS linked_revs""", - """ - CREATE TABLE users ( + "DROP TABLE IF EXISTS users", + """CREATE TABLE users ( id SERIAL PRIMARY KEY, userid VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, realname VARCHAR(255) NOT NULL - ) - """, + ) + """, "UPDATE scheme SET version=13", - ), + ) schemes[14] = ( + "DROP TABLE IF EXISTS linked_revs", """ CREATE TABLE linked_revs ( id SERIAL PRIMARY KEY, @@ -182,11 +182,11 @@ class DB: """, "UPDATE scheme SET version=14", ) - schemes[14] = ( - "ALTER TABLE revisions ALTER COLUMN rev TYPE real USING rev::real", - "UPDATE scheme SET version=14", - ) schemes[15] = ( + "ALTER TABLE revisions ALTER COLUMN rev TYPE real USING rev::real", + "UPDATE scheme SET version=15", + ) + schemes[16] = ( """DROP TABLE IF EXISTS fake_revs""", """ CREATE TABLE fake_revs ( @@ -196,16 +196,16 @@ class DB: ) """, "create index revs_linked on fake_revs (revision_id,linked_id)", - "UPDATE scheme SET version=15", - ) - schemes[16] = ( - "ALTER TABLE revisions ADD COLUMN files_hash VARCHAR(40)", "UPDATE scheme SET version=16", ) schemes[17] = ( - "ALTER TABLE linked_revs ADD COLUMN considered BOOLEAN DEFAULT FALSE", + "ALTER TABLE revisions ADD COLUMN files_hash VARCHAR(40)", "UPDATE scheme SET version=17", ) + schemes[18] = ( + "ALTER TABLE linked_revs ADD COLUMN considered BOOLEAN DEFAULT FALSE", + "UPDATE scheme SET version=18", + ) schema_version = self.schema_version() if (schema_version + 1) not in schemes: return