Синхронизация, фикс ошибок

This commit is contained in:
RoyceDa
2026-02-15 18:15:03 +02:00
parent 8b906169ce
commit 4a505ab974
6 changed files with 73 additions and 17 deletions

View File

@@ -17,6 +17,7 @@ export function DatabaseProvider(props: DatabaseProviderProps) {
(async () => {
await createAllTables();
setInitialized(true);
//await runQuery("DROP TABLE IF EXISTS accounts_sync_times");
})();
}, []);

View File

@@ -73,5 +73,15 @@ export const TABLES = [
last_timestamp INTEGER NOT NULL,
is_request INTEGER NOT NULL DEFAULT 0,
UNIQUE (id)
)`,
/**
* Таблица для хранения времени последней синхронизации сообщений
* last_sync время отключения клиента от сервера
*/
`CREATE TABLE IF NOT EXISTS accounts_sync_times (
id INTEGER PRIMARY KEY,
account TEXT NOT NULL,
last_sync INTEGER NOT NULL,
UNIQUE (account)
)`
]