This commit is contained in:
Hamza-Ayed
2023-08-15 23:55:41 +03:00
parent 65ade9c874
commit 9b3716aabd
19 changed files with 466 additions and 189 deletions

View File

@@ -1,3 +1,4 @@
import 'package:ride/constant/table_names.dart';
import 'package:sqflite/sqflite.dart';
import 'package:path/path.dart';
@@ -21,7 +22,7 @@ class DbSql {
version: 1,
onCreate: (db, version) async {
await db.execute('''
CREATE TABLE IF NOT EXISTS car_locations(
CREATE TABLE IF NOT EXISTS ${TableName.carLocations}(
id INTEGER PRIMARY KEY AUTOINCREMENT,
driver_id INTEGER,
latitude REAL,
@@ -30,6 +31,15 @@ class DbSql {
updated_at TEXT
)
''');
await db.execute('''
CREATE TABLE IF NOT EXISTS ${TableName.placesFavorite}(
id INTEGER PRIMARY KEY AUTOINCREMENT,
latitude REAL,
longitude REAL,
name TEXT UNIQUE,
rate TEXT
)
''');
},
);
}