forked from farion1231/cc-switch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_version.py
More file actions
30 lines (23 loc) · 840 Bytes
/
Copy pathfix_version.py
File metadata and controls
30 lines (23 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sqlite3
db_path = r"C:\Users\Roberto Amaral\.cc-switch\cc-switch.db"
conn = sqlite3.connect(db_path)
cur = conn.cursor()
# Verificar versao atual
cur.execute("PRAGMA user_version")
old = cur.fetchone()[0]
print(f"Versao ANTES: {old}")
# Redefinir para 11 (binario atual suporta apenas v11)
cur.execute("PRAGMA user_version = 11")
# Verificar
cur.execute("PRAGMA user_version")
new = cur.fetchone()[0]
print(f"Versao DEPOIS: {new}")
# Confirmar dados intactos
cur.execute("SELECT COUNT(*) FROM managed_backends")
print(f"managed_backends: {cur.fetchone()[0]} registros")
cur.execute("SELECT COUNT(*) FROM proxy_config")
print(f"proxy_config: {cur.fetchone()[0]} registros")
cur.execute("SELECT COUNT(*) FROM providers")
print(f"providers: {cur.fetchone()[0]} registros")
conn.close()
print("\nPronto! O app deve abrir agora.")