Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/modules/wiki/updatedatabase.py

22 lines
528 B
Python
Raw Normal View History

import traceback
2021-03-21 05:12:52 +00:00
import os
import sqlite3
dbpath = os.path.abspath('./save.db')
conn = sqlite3.connect(dbpath)
c = conn.cursor()
try:
a = c.execute(f"ALTER TABLE start_wiki_link_self RENAME TO start_wiki_link_Friend")
except:
traceback.print_exc()
try:
a = c.execute(f"ALTER TABLE custom_interwiki_self RENAME TO custom_interwiki_Friend")
except:
traceback.print_exc()
try:
a = c.execute(f"ALTER TABLE request_headers_self RENAME TO request_headers_Friend")
except:
traceback.print_exc()
conn.commit()