mirror of https://github.com/AMT-Cheif/drift.git
Fix typo in README
This commit is contained in:
parent
db4948f842
commit
bb0ed3137e
|
@ -161,8 +161,8 @@ Future moveImportantTasksIntoCategory(Category target) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future feelingLazy() {
|
Future feelingLazy() {
|
||||||
// delete 10 todo entries just cause
|
// delete the oldest nine entries
|
||||||
return (delete(todos)..limit(10)).go();
|
return (delete(todos)..where((t) => t.id.isSmallerThanValue(10))).go();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
__⚠️ Caution:__ If you don't explicitly add a `where` clause on updates or deletes,
|
__⚠️ Caution:__ If you don't explicitly add a `where` clause on updates or deletes,
|
||||||
|
@ -205,7 +205,7 @@ class Todos extends Table {
|
||||||
We can now change the `database` class like this:
|
We can now change the `database` class like this:
|
||||||
```dart
|
```dart
|
||||||
@override
|
@override
|
||||||
int get schemaVersion => 1; // bump because the tables have changed
|
int get schemaVersion => 2; // bump because the tables have changed
|
||||||
|
|
||||||
@override
|
@override
|
||||||
MigrationStrategy get migration => MigrationStrategy(
|
MigrationStrategy get migration => MigrationStrategy(
|
||||||
|
@ -214,7 +214,7 @@ We can now change the `database` class like this:
|
||||||
},
|
},
|
||||||
onUpgrade: (Migrator m, int from, int to) async {
|
onUpgrade: (Migrator m, int from, int to) async {
|
||||||
if (from == 1) {
|
if (from == 1) {
|
||||||
// we added the dueDate propery in the change from version 1
|
// we added the dueDate property in the change from version 1
|
||||||
await m.addColumn(todos, todos.dueDate);
|
await m.addColumn(todos, todos.dueDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,8 +161,8 @@ Future moveImportantTasksIntoCategory(Category target) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future feelingLazy() {
|
Future feelingLazy() {
|
||||||
// delete 10 todo entries just cause
|
// delete the oldest nine entries
|
||||||
return (delete(todos)..limit(10)).go();
|
return (delete(todos)..where((t) => t.id.isSmallerThanValue(10))).go();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
__⚠️ Caution:__ If you don't explicitly add a `where` clause on updates or deletes,
|
__⚠️ Caution:__ If you don't explicitly add a `where` clause on updates or deletes,
|
||||||
|
@ -205,7 +205,7 @@ class Todos extends Table {
|
||||||
We can now change the `database` class like this:
|
We can now change the `database` class like this:
|
||||||
```dart
|
```dart
|
||||||
@override
|
@override
|
||||||
int get schemaVersion => 1; // bump because the tables have changed
|
int get schemaVersion => 2; // bump because the tables have changed
|
||||||
|
|
||||||
@override
|
@override
|
||||||
MigrationStrategy get migration => MigrationStrategy(
|
MigrationStrategy get migration => MigrationStrategy(
|
||||||
|
@ -214,7 +214,7 @@ We can now change the `database` class like this:
|
||||||
},
|
},
|
||||||
onUpgrade: (Migrator m, int from, int to) async {
|
onUpgrade: (Migrator m, int from, int to) async {
|
||||||
if (from == 1) {
|
if (from == 1) {
|
||||||
// we added the dueDate propery in the change from version 1
|
// we added the dueDate property in the change from version 1
|
||||||
await m.addColumn(todos, todos.dueDate);
|
await m.addColumn(todos, todos.dueDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue