Skip to content

Commit

Permalink
revert some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dickermoshe committed Dec 11, 2024
1 parent 24d2dc8 commit c9ee6ff
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 14 deletions.
110 changes: 107 additions & 3 deletions examples/app/lib/database/database.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions examples/app/lib/database/tables.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ export 'dart:ui' show Color;

import 'package:drift/drift.dart';

class TodoEntry {
final String description;
final int? category;
final DateTime? dueDate;

TodoEntry(this.description, this.category, this.dueDate);
}

@UseRowClass(TodoEntry)
@DataClassName('TodoEntry')
class TodoEntries extends Table with AutoIncrementingPrimaryKey {
TextColumn get description => text()();

Expand Down
8 changes: 6 additions & 2 deletions examples/app/test/migration_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:app/database/database.dart';
import 'package:app/database/tables.dart';
import 'package:drift/drift.dart';
import 'package:drift_dev/api/migrations_native.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down Expand Up @@ -59,7 +58,12 @@ void main() {
expect(
db.todoEntries.select().get(),
completion(
[TodoEntry('My manually added entry', 0, null)],
[
const TodoEntry(
id: 1,
description: 'My manually added entry',
)
],
),
);
});
Expand Down

0 comments on commit c9ee6ff

Please sign in to comment.