添加db_migrate功能

This commit is contained in:
CN-JS-HuiBai
2026-04-22 21:24:43 +08:00
parent ce739d1232
commit 1430ecf366
4 changed files with 9 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ const prometheusService = require('./prometheus-service');
const cache = require('./cache');
const geoService = require('./geo-service');
const latencyService = require('./latency-service');
const checkAndFixDatabase = require('./db-schema-check');
const db_migrate = require('./db-schema-check');
const http = require('http');
const WebSocket = require('ws');
const net = require('net');
@@ -651,7 +651,7 @@ APP_SECRET=${process.env.APP_SECRET || APP_SECRET}
cache.init();
// Run the migration/centralized schema tool to create/fix all tables
await checkAndFixDatabase();
await db_migrate();
isDbInitialized = true;
res.json({ success: true, message: 'Initialization complete' });
@@ -1509,7 +1509,7 @@ async function start() {
// 2. Automated repair/migration
try {
const dbFixed = await checkAndFixDatabase();
const dbFixed = await db_migrate();
if (dbFixed) {
// Refresh state after fix
await checkDb();