Reshuffle schema versions after rebase
This commit is contained in:
parent
9dbf3b9094
commit
1346223822
30
lib/db.py
30
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
|
||||
|
Loading…
Reference in New Issue
Block a user