DmitrMakeev
commited on
Commit
•
2a6271f
1
Parent(s):
3f95689
Update app.py
Browse files
app.py
CHANGED
@@ -63,42 +63,47 @@ 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 |
''')
|
97 |
conn.commit()
|
98 |
conn.close()
|
99 |
|
100 |
for db in DATABASES:
|
101 |
-
|
102 |
|
103 |
|
104 |
template = {
|
|
|
63 |
|
64 |
DATABASES = ['data_gc.db', 'data1.db', 'data2.db', 'data3.db', 'data4.db', 'data5.db']
|
65 |
|
66 |
+
def init_db(db_name):
|
67 |
conn = sqlite3.connect(db_name)
|
68 |
cursor = conn.cursor()
|
69 |
cursor.execute('''
|
70 |
+
CREATE TABLE IF NOT EXISTS contacts (
|
71 |
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
72 |
+
name TEXT NOT NULL,
|
73 |
+
phone TEXT NOT NULL,
|
74 |
+
email TEXT NOT NULL,
|
75 |
+
vk_id TEXT,
|
76 |
+
chat_id TEXT,
|
77 |
+
ws_st TEXT,
|
78 |
+
ws_stop TEXT,
|
79 |
+
web_st INTEGER,
|
80 |
+
fin_prog INTEGER,
|
81 |
+
b_city TEXT,
|
82 |
+
b_fin TEXT,
|
83 |
+
b_ban TEXT,
|
84 |
+
b_ign TEXT,
|
85 |
+
b_baners TEXT,
|
86 |
+
b_butt TEXT,
|
87 |
+
b_mess TEXT,
|
88 |
+
shop_st TEXT,
|
89 |
+
curator TEXT,
|
90 |
+
pr1 TEXT,
|
91 |
+
pr2 TEXT,
|
92 |
+
pr3 TEXT,
|
93 |
+
pr4 TEXT,
|
94 |
+
pr5 TEXT,
|
95 |
+
ad_url TEXT,
|
96 |
+
key_pr TEXT,
|
97 |
+
n_con TEXT,
|
98 |
+
canal TEXT,
|
99 |
+
data_t TEXT
|
100 |
+
)
|
101 |
''')
|
102 |
conn.commit()
|
103 |
conn.close()
|
104 |
|
105 |
for db in DATABASES:
|
106 |
+
init_db(db)
|
107 |
|
108 |
|
109 |
template = {
|