fix outlet, fix category, fix printer
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import '../../env.dart';
|
||||
import '../../injection.dart';
|
||||
|
||||
class AppConstant {
|
||||
static const String appName = "Apskel POS";
|
||||
static const String dbName = "apskel_pos.db";
|
||||
static String dbName = getIt<Env>().dbName;
|
||||
static const int cacheExpire = 10; // in minutes
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class DatabaseHelper {
|
||||
|
||||
return await openDatabase(
|
||||
path,
|
||||
version: 2, // Updated version for categories table
|
||||
version: 1, // Updated version for categories table
|
||||
onCreate: _onCreate,
|
||||
onUpgrade: _onUpgrade,
|
||||
);
|
||||
@@ -68,6 +68,7 @@ class DatabaseHelper {
|
||||
name TEXT NOT NULL,
|
||||
description TEXT,
|
||||
business_type TEXT,
|
||||
sort_order INTEGER DEFAULT 0,
|
||||
metadata TEXT,
|
||||
is_active INTEGER DEFAULT 1,
|
||||
created_at TEXT,
|
||||
@@ -106,13 +107,7 @@ class DatabaseHelper {
|
||||
await db.execute('CREATE INDEX idx_printers_type ON printers(type)');
|
||||
}
|
||||
|
||||
Future<void> _onUpgrade(Database db, int oldVersion, int newVersion) async {
|
||||
if (oldVersion < 2) {
|
||||
await db.execute(
|
||||
'ALTER TABLE categories ADD COLUMN "order" INTEGER DEFAULT 0',
|
||||
);
|
||||
}
|
||||
}
|
||||
Future<void> _onUpgrade(Database db, int oldVersion, int newVersion) async {}
|
||||
|
||||
Future<void> close() async {
|
||||
final db = await database;
|
||||
|
||||
Reference in New Issue
Block a user