Commit ·
6e0803d
1
Parent(s): 0f621e0
feat: 添加插件自动启用配置字段
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):
|
|
@@ -238,6 +238,7 @@ class Database:
|
|
| 238 |
CREATE TABLE plugin_config (
|
| 239 |
id INTEGER PRIMARY KEY DEFAULT 1,
|
| 240 |
connection_token TEXT DEFAULT '',
|
|
|
|
| 241 |
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
| 242 |
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
| 243 |
)
|
|
@@ -524,6 +525,7 @@ class Database:
|
|
| 524 |
CREATE TABLE IF NOT EXISTS plugin_config (
|
| 525 |
id INTEGER PRIMARY KEY DEFAULT 1,
|
| 526 |
connection_token TEXT DEFAULT '',
|
|
|
|
| 527 |
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
| 528 |
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
| 529 |
)
|
|
|
|
| 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):
|
|
|
|
| 238 |
CREATE TABLE plugin_config (
|
| 239 |
id INTEGER PRIMARY KEY DEFAULT 1,
|
| 240 |
connection_token TEXT DEFAULT '',
|
| 241 |
+
auto_enable_on_update BOOLEAN DEFAULT 1,
|
| 242 |
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
| 243 |
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
| 244 |
)
|
|
|
|
| 525 |
CREATE TABLE IF NOT EXISTS plugin_config (
|
| 526 |
id INTEGER PRIMARY KEY DEFAULT 1,
|
| 527 |
connection_token TEXT DEFAULT '',
|
| 528 |
+
auto_enable_on_update BOOLEAN DEFAULT 1,
|
| 529 |
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
| 530 |
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
| 531 |
)
|