Kapcsolat hozzáadása koordinátával a terepbejárás térképen.
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s

This commit is contained in:
2026-08-06 16:14:30 +02:00
parent 7f514da38f
commit 950c2f48f1
10 changed files with 239 additions and 21 deletions
+16 -1
View File
@@ -46,7 +46,7 @@ class AppDatabase {
final path = p.join(dbDir.path, 'terepi_seged.db');
return openDatabase(path,
version: 6,
version: 7,
onConfigure: (db) => db.execute('PRAGMA foreign_keys = ON'),
onCreate: _onCreate,
onUpgrade: _onUpgrade);
@@ -271,7 +271,9 @@ class AppDatabase {
await _createStakeoutTable(db);
await _createContactsOutbox(db);
await _addAppInstanceIdColumns(db);
await _addContactLocationColumns(db);
await _createVibratorNavTables(db);
@@ -312,6 +314,7 @@ class AppDatabase {
await _addAppInstanceIdColumns(db);
await _createVibratorNavTables(db);
await _addContactLocationColumns(db);
}
Future<void> _migrateToV4(Database db) async {
@@ -1327,6 +1330,10 @@ class AppDatabase {
phone TEXT NOT NULL DEFAULT '',
email TEXT NOT NULL DEFAULT '',
note TEXT NOT NULL DEFAULT '',
lat REAL,
lon REAL,
eov_y REAL,
eov_x REAL,
created_at TEXT NOT NULL
)
''');
@@ -1334,6 +1341,14 @@ class AppDatabase {
'ON contacts_outbox(project_id)');
}
/// Idempotens oszlop-pótlás, ha a contacts_outbox már létezik (korábbi
/// telepítéseknél) — ugyanaz a minta, mint az app_instance_id-nél.
Future<void> _addContactLocationColumns(Database db) async {
for (final col in ['lat', 'lon', 'eov_y', 'eov_x']) {
await _tryExec(db, 'ALTER TABLE contacts_outbox ADD COLUMN $col REAL');
}
}
Future<void> insertPendingContact(Map<String, dynamic> row) async {
final db = await database;
await db.insert('contacts_outbox', row);