chore: remove pre-release schema migrations
This commit is contained in:
parent
5b79f2f83f
commit
6554330bed
1 changed files with 0 additions and 24 deletions
|
|
@ -248,30 +248,6 @@ def init_db():
|
||||||
" added_at TEXT DEFAULT (strftime('%Y-%m-%dT%H:%M:%S','now'))"
|
" added_at TEXT DEFAULT (strftime('%Y-%m-%dT%H:%M:%S','now'))"
|
||||||
")"
|
")"
|
||||||
)
|
)
|
||||||
# Migrate old subscriptions table if needed
|
|
||||||
cols = [row[1] for row in db.execute("PRAGMA table_info(subscriptions)").fetchall()]
|
|
||||||
if "url" in cols and "dest_hash" not in cols:
|
|
||||||
db.execute("ALTER TABLE subscriptions RENAME COLUMN url TO dest_hash")
|
|
||||||
db.commit()
|
|
||||||
|
|
||||||
# Migrate remote_pages: add tags column if missing
|
|
||||||
rp_cols = [row[1] for row in db.execute("PRAGMA table_info(remote_pages)").fetchall()]
|
|
||||||
if "tags" not in rp_cols:
|
|
||||||
db.execute("ALTER TABLE remote_pages ADD COLUMN tags TEXT DEFAULT ''")
|
|
||||||
db.commit()
|
|
||||||
|
|
||||||
# Migrate pages: add last_modified column if missing
|
|
||||||
page_cols = [row[1] for row in db.execute("PRAGMA table_info(pages)").fetchall()]
|
|
||||||
if "last_modified" not in page_cols:
|
|
||||||
db.execute("ALTER TABLE pages ADD COLUMN last_modified TEXT DEFAULT ''")
|
|
||||||
db.execute("UPDATE pages SET last_modified = strftime('%Y-%m-%dT%H:%M:%S','now') WHERE last_modified = ''")
|
|
||||||
db.commit()
|
|
||||||
|
|
||||||
# Migrate pages: add summary column if missing
|
|
||||||
if "summary" not in page_cols:
|
|
||||||
db.execute("ALTER TABLE pages ADD COLUMN summary TEXT DEFAULT ''")
|
|
||||||
db.commit()
|
|
||||||
|
|
||||||
# Migrate pages: add reticulum_dest column if missing
|
# Migrate pages: add reticulum_dest column if missing
|
||||||
if "reticulum_dest" not in page_cols:
|
if "reticulum_dest" not in page_cols:
|
||||||
db.execute("ALTER TABLE pages ADD COLUMN reticulum_dest TEXT DEFAULT ''")
|
db.execute("ALTER TABLE pages ADD COLUMN reticulum_dest TEXT DEFAULT ''")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue