diff --git a/src/tinyweb/db.py b/src/tinyweb/db.py index c8138dc..b794b7c 100644 --- a/src/tinyweb/db.py +++ b/src/tinyweb/db.py @@ -248,30 +248,6 @@ def init_db(): " 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 if "reticulum_dest" not in page_cols: db.execute("ALTER TABLE pages ADD COLUMN reticulum_dest TEXT DEFAULT ''")