Upload database.py
Browse files- src/core/database.py +4 -2
src/core/database.py
CHANGED
|
@@ -172,8 +172,8 @@ class Database:
|
|
| 172 |
count = await cursor.fetchone()
|
| 173 |
if count[0] == 0:
|
| 174 |
await db.execute("""
|
| 175 |
-
INSERT INTO plugin_config (id, connection_token)
|
| 176 |
-
VALUES (1, '')
|
| 177 |
""")
|
| 178 |
|
| 179 |
async def check_and_migrate_db(self, config_dict: dict = None):
|
|
@@ -232,6 +232,7 @@ class Database:
|
|
| 232 |
CREATE TABLE plugin_config (
|
| 233 |
id INTEGER PRIMARY KEY DEFAULT 1,
|
| 234 |
connection_token TEXT DEFAULT '',
|
|
|
|
| 235 |
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
| 236 |
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
| 237 |
)
|
|
@@ -503,6 +504,7 @@ class Database:
|
|
| 503 |
CREATE TABLE IF NOT EXISTS plugin_config (
|
| 504 |
id INTEGER PRIMARY KEY DEFAULT 1,
|
| 505 |
connection_token TEXT DEFAULT '',
|
|
|
|
| 506 |
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
| 507 |
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
| 508 |
)
|
|
|
|
| 172 |
count = await cursor.fetchone()
|
| 173 |
if count[0] == 0:
|
| 174 |
await db.execute("""
|
| 175 |
+
INSERT INTO plugin_config (id, connection_token, auto_enable_on_update)
|
| 176 |
+
VALUES (1, '', 1)
|
| 177 |
""")
|
| 178 |
|
| 179 |
async def check_and_migrate_db(self, config_dict: dict = None):
|
|
|
|
| 232 |
CREATE TABLE plugin_config (
|
| 233 |
id INTEGER PRIMARY KEY DEFAULT 1,
|
| 234 |
connection_token TEXT DEFAULT '',
|
| 235 |
+
auto_enable_on_update BOOLEAN DEFAULT 1,
|
| 236 |
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
| 237 |
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
| 238 |
)
|
|
|
|
| 504 |
CREATE TABLE IF NOT EXISTS plugin_config (
|
| 505 |
id INTEGER PRIMARY KEY DEFAULT 1,
|
| 506 |
connection_token TEXT DEFAULT '',
|
| 507 |
+
auto_enable_on_update BOOLEAN DEFAULT 1,
|
| 508 |
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
| 509 |
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
| 510 |
)
|