Skip to content

Commit 1ea64aa

Browse files
Update deploy.yml
1 parent 8e1e172 commit 1ea64aa

1 file changed

Lines changed: 41 additions & 19 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,50 @@ jobs:
2828
2929
- name: 🗃️ Create FULL test database with correct schema
3030
run: |
31-
python -c '
31+
python -c "
3232
import sqlite3
33-
conn = sqlite3.connect("sites.db")
34-
conn.execute("CREATE TABLE IF NOT EXISTS sites (
35-
id INTEGER PRIMARY KEY AUTOINCREMENT,
36-
url TEXT NOT NULL,
37-
check_interval INTEGER DEFAULT 60,
38-
expected_text TEXT,
39-
enabled INTEGER DEFAULT 1
40-
)")
41-
conn.execute("CREATE TABLE IF NOT EXISTS logs (
42-
id INTEGER PRIMARY KEY AUTOINCREMENT,
43-
site_id INTEGER,
44-
status INTEGER,
45-
response_time REAL,
46-
timestamp TEXT,
47-
FOREIGN KEY (site_id) REFERENCES sites (id)
48-
)")
33+
import os
34+
35+
# Убедимся, что создаём в текущей директории
36+
db_path = 'sites.db'
37+
print(f'📁 Создаём базу данных: {os.path.abspath(db_path)}')
38+
39+
conn = sqlite3.connect(db_path)
40+
41+
# Создаём таблицу sites
42+
conn.execute('''
43+
CREATE TABLE IF NOT EXISTS sites (
44+
id INTEGER PRIMARY KEY AUTOINCREMENT,
45+
url TEXT NOT NULL,
46+
check_interval INTEGER DEFAULT 60,
47+
expected_text TEXT,
48+
enabled INTEGER DEFAULT 1
49+
)
50+
''')
51+
52+
# Создаём таблицу logs
53+
conn.execute('''
54+
CREATE TABLE IF NOT EXISTS logs (
55+
id INTEGER PRIMARY KEY AUTOINCREMENT,
56+
site_id INTEGER,
57+
status INTEGER,
58+
response_time REAL,
59+
timestamp TEXT,
60+
FOREIGN KEY (site_id) REFERENCES sites (id)
61+
)
62+
''')
63+
4964
conn.commit()
5065
conn.close()
51-
print("✅ Fully initialized database created")
52-
'
66+
67+
print('✅ Таблицы успешно созданы')
68+
print('🔍 Проверка структуры:')
69+
conn = sqlite3.connect(db_path)
70+
cursor = conn.cursor()
71+
cursor.execute('PRAGMA table_info(sites)')
72+
print(cursor.fetchall())
73+
conn.close()
74+
"
5375
5476
- name: 📁 Create dummy templates
5577
run: |

0 commit comments

Comments
 (0)