db: remove pre-release custom_template migrations
This commit is contained in:
parent
6554330bed
commit
c386091463
1 changed files with 0 additions and 18 deletions
|
|
@ -280,24 +280,6 @@ def init_db():
|
|||
db.execute("CREATE INDEX IF NOT EXISTS idx_page_tags_page ON page_tags(page_id)")
|
||||
db.execute("CREATE INDEX IF NOT EXISTS idx_page_tags_tag ON page_tags(tag_id)")
|
||||
|
||||
# Migrate custom_template: replace hardcoded forum link with {{forum_link}} placeholder
|
||||
cur = db.execute("SELECT value FROM settings WHERE key='custom_template'")
|
||||
row = cur.fetchone()
|
||||
if row:
|
||||
updated = row[0].replace('<a href="/forum">forum</a>', "{{forum_link}}")
|
||||
if updated != row[0]:
|
||||
db.execute("UPDATE settings SET value=? WHERE key='custom_template'", (updated,))
|
||||
db.commit()
|
||||
|
||||
# Migrate custom_template: replace hardcoded site name with {{site_name}} placeholder
|
||||
cur = db.execute("SELECT value FROM settings WHERE key='custom_template'")
|
||||
row = cur.fetchone()
|
||||
if row and '{{site_name}}' not in row[0]:
|
||||
updated = row[0].replace('href="/">tinyweb</a>', 'href="/">{{site_name}}</a>')
|
||||
if updated != row[0]:
|
||||
db.execute("UPDATE settings SET value=? WHERE key='custom_template'", (updated,))
|
||||
db.commit()
|
||||
|
||||
db.execute("PRAGMA journal_mode=WAL")
|
||||
db.execute("PRAGMA synchronous=NORMAL")
|
||||
db.execute("PRAGMA cache_size=-64000")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue