Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions lib/core/router/app_router.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:bookmarkedapp/data/models/library_entry.dart';
import 'package:bookmarkedapp/screens/book_detail/book_detail_screen.dart';
import 'package:bookmarkedapp/screens/home/home_screen.dart';
import 'package:bookmarkedapp/screens/library/library_screen.dart';
Expand Down Expand Up @@ -60,17 +59,6 @@ final appRouter = GoRouter(
return BookDetailScreen(bookId: id);
},
),
GoRoute(
path: '/library/status/:status',
parentNavigatorKey: _rootNavigatorKey,
builder: (context, state) {
final statusName = state.pathParameters['status']!;
return LibraryScreen(
filterStatus: ReadingStatus.fromDbValue(statusName),
showBackButton: true,
);
},
),
],
);

Expand Down
16 changes: 15 additions & 1 deletion lib/data/database/app_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class BookRecords extends Table {
TextColumn get coverUrl => text().nullable()();
IntColumn get pageCount => integer().nullable()();
TextColumn get description => text().nullable()();
IntColumn get publishedYear => integer().nullable()();
TextColumn get genres => text().nullable()();
TextColumn get publisher => text().nullable()();

@override
Set<Column<Object>> get primaryKey => {id};
Expand All @@ -38,7 +41,18 @@ class AppDatabase extends _$AppDatabase {
AppDatabase() : super(_openConnection());

@override
int get schemaVersion => 1;
int get schemaVersion => 2;

@override
MigrationStrategy get migration => MigrationStrategy(
onUpgrade: (migrator, from, to) async {
if (from < 2) {
await migrator.addColumn(bookRecords, bookRecords.publishedYear);
await migrator.addColumn(bookRecords, bookRecords.genres);
await migrator.addColumn(bookRecords, bookRecords.publisher);
}
},
);
}

LazyDatabase _openConnection() {
Expand Down
Loading