Importált rétegek stílusának szerkesztése

This commit is contained in:
2026-07-04 23:36:01 +02:00
parent 077b40967c
commit 2cf83149f0
12 changed files with 341 additions and 64 deletions
+17 -2
View File
@@ -38,7 +38,7 @@ class AppDatabase {
final path = p.join(dbDir.path, 'terepi_seged.db');
return openDatabase(path,
version: 1,
version: 2,
onConfigure: (db) => db.execute('PRAGMA foreign_keys = ON'),
onCreate: _onCreate,
onUpgrade: _onUpgrade);
@@ -202,6 +202,9 @@ class AppDatabase {
source_type TEXT NOT NULL,
local_path TEXT NOT NULL,
storage_path TEXT,
color_hex TEXT,
opacity REAL,
stroke_width REAL,
is_visible INTEGER NOT NULL DEFAULT 1,
project_id INTEGER,
imported_at TEXT NOT NULL,
@@ -224,7 +227,19 @@ class AppDatabase {
});
}
Future<void> _onUpgrade(Database db, int oldVersion, int newVersion) async {}
Future<void> _onUpgrade(Database db, int oldVersion, int newVersion) async {
if (oldVersion < 2) {
await db.execute('''
ALTER TABLE imported_layers ADD COLUMN color_hex TEXT;
''');
await db.execute('''
ALTER TABLE imported_layers ADD COLUMN opacity REAL;
''');
await db.execute('''
ALTER TABLE imported_layers ADD COLUMN stroke_width REAL;
''');
}
}
// ── Projects CRUD ─────────────────────────────────────────────────