Enhance database management and synchronization features

- Added new backup and restore functionality for JSON and SQLite database formats.
- Implemented notification settings for low balance alerts and sync digests in the settings page.
- Updated database schema to include new columns for balance alert thresholds and notification preferences.
- Refactored synchronization logic to provide detailed summaries and improved error handling.
- Enhanced user interface for managing accounts and settings, including new input fields for balance alerts.
- Improved sync log display to include summary information for better tracking of synchronization results.
This commit is contained in:
Denozordec
2026-03-20 23:11:58 +07:00
parent 994dde2314
commit 196c5be532
20 changed files with 1342 additions and 130 deletions
+35
View File
@@ -231,4 +231,39 @@ export const MIGRATIONS = [
) WHERE length(trim(COALESCE(vps.project, ''))) > 0`)
},
},
{
name: 'sync_log_summary',
run(db) {
try {
db.exec('ALTER TABLE sync_log ADD COLUMN summary TEXT')
} catch (e) {
if (!String(e.message || e).includes('duplicate column')) throw e
}
},
},
{
name: 'settings_notify_balance_digest',
run(db) {
try {
db.exec('ALTER TABLE settings ADD COLUMN notifyLowBalanceEnabled INTEGER')
} catch (e) {
if (!String(e.message || e).includes('duplicate column')) throw e
}
try {
db.exec('ALTER TABLE settings ADD COLUMN notifySyncDigestEnabled INTEGER')
} catch (e) {
if (!String(e.message || e).includes('duplicate column')) throw e
}
},
},
{
name: 'provider_accounts_balance_alert_below',
run(db) {
try {
db.exec('ALTER TABLE provider_accounts ADD COLUMN balance_alert_below REAL')
} catch (e) {
if (!String(e.message || e).includes('duplicate column')) throw e
}
},
},
]