DmitrMakeev
commited on
Commit
•
3f95689
1
Parent(s):
9a2cc8e
Update app.py
Browse files
app.py
CHANGED
@@ -63,48 +63,42 @@ if not os.path.exists(UPLOAD_FOLDER):
|
|
63 |
|
64 |
DATABASES = ['data_gc.db', 'data1.db', 'data2.db', 'data3.db', 'data4.db', 'data5.db']
|
65 |
|
66 |
-
def
|
67 |
conn = sqlite3.connect(db_name)
|
68 |
cursor = conn.cursor()
|
69 |
cursor.execute('''
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
key_pr TEXT NOT NULL,
|
97 |
-
n_con TEXT NOT NULL,
|
98 |
-
canal TEXT NOT NULL,
|
99 |
-
data_t TEXT NOT NULL
|
100 |
-
)
|
101 |
''')
|
102 |
conn.commit()
|
103 |
conn.close()
|
104 |
|
105 |
for db in DATABASES:
|
106 |
-
|
107 |
-
|
108 |
|
109 |
|
110 |
template = {
|
|
|
63 |
|
64 |
DATABASES = ['data_gc.db', 'data1.db', 'data2.db', 'data3.db', 'data4.db', 'data5.db']
|
65 |
|
66 |
+
def alter_db_schema(db_name):
|
67 |
conn = sqlite3.connect(db_name)
|
68 |
cursor = conn.cursor()
|
69 |
cursor.execute('''
|
70 |
+
ALTER TABLE contacts
|
71 |
+
ALTER COLUMN vk_id SET DEFAULT NULL,
|
72 |
+
ALTER COLUMN chat_id SET DEFAULT NULL,
|
73 |
+
ALTER COLUMN ws_st SET DEFAULT NULL,
|
74 |
+
ALTER COLUMN ws_stop SET DEFAULT NULL,
|
75 |
+
ALTER COLUMN web_st SET DEFAULT NULL,
|
76 |
+
ALTER COLUMN fin_prog SET DEFAULT NULL,
|
77 |
+
ALTER COLUMN b_city SET DEFAULT NULL,
|
78 |
+
ALTER COLUMN b_fin SET DEFAULT NULL,
|
79 |
+
ALTER COLUMN b_ban SET DEFAULT NULL,
|
80 |
+
ALTER COLUMN b_ign SET DEFAULT NULL,
|
81 |
+
ALTER COLUMN b_baners SET DEFAULT NULL,
|
82 |
+
ALTER COLUMN b_butt SET DEFAULT NULL,
|
83 |
+
ALTER COLUMN b_mess SET DEFAULT NULL,
|
84 |
+
ALTER COLUMN shop_st SET DEFAULT NULL,
|
85 |
+
ALTER COLUMN curator SET DEFAULT NULL,
|
86 |
+
ALTER COLUMN pr1 SET DEFAULT NULL,
|
87 |
+
ALTER COLUMN pr2 SET DEFAULT NULL,
|
88 |
+
ALTER COLUMN pr3 SET DEFAULT NULL,
|
89 |
+
ALTER COLUMN pr4 SET DEFAULT NULL,
|
90 |
+
ALTER COLUMN pr5 SET DEFAULT NULL,
|
91 |
+
ALTER COLUMN ad_url SET DEFAULT NULL,
|
92 |
+
ALTER COLUMN key_pr SET DEFAULT NULL,
|
93 |
+
ALTER COLUMN n_con SET DEFAULT NULL,
|
94 |
+
ALTER COLUMN canal SET DEFAULT NULL,
|
95 |
+
ALTER COLUMN data_t SET DEFAULT NULL;
|
|
|
|
|
|
|
|
|
|
|
96 |
''')
|
97 |
conn.commit()
|
98 |
conn.close()
|
99 |
|
100 |
for db in DATABASES:
|
101 |
+
alter_db_schema(db)
|
|
|
102 |
|
103 |
|
104 |
template = {
|