Kapcsolat hozzáadása koordinátával a terepbejárás térképen.
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -108,6 +108,10 @@ class ContactService extends GetxService {
|
||||
'phone': c.phone.trim(),
|
||||
'email': c.email.trim(),
|
||||
'note': c.note.trim(),
|
||||
'lat': c.lat,
|
||||
'lon': c.lon,
|
||||
'eov_y': c.eovY,
|
||||
'eov_x': c.eovX,
|
||||
'created_at': DateTime.now().toIso8601String(),
|
||||
});
|
||||
return true; // várólistán
|
||||
@@ -160,6 +164,10 @@ class ContactService extends GetxService {
|
||||
'phone': m['phone'],
|
||||
'email': m['email'],
|
||||
'note': m['note'],
|
||||
'lat': m['lat'],
|
||||
'lon': m['lon'],
|
||||
'eov_y': m['eov_y'],
|
||||
'eov_x': m['eov_x'],
|
||||
}, onConflict: 'client_uuid', ignoreDuplicates: true);
|
||||
|
||||
// Sikeres felküldés → a lokális példány törölhető.
|
||||
|
||||
Reference in New Issue
Block a user