fix outlet, fix category, fix printer

This commit is contained in:
efrilm
2025-11-13 12:01:24 +07:00
parent b2b2e2b111
commit 6fa45c8ac0
7 changed files with 35 additions and 12 deletions
+3 -8
View File
@@ -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;