Fix tests, which are also failing due to views

This commit is contained in:
Simon Binder 2022-12-07 21:46:54 +01:00
parent c4eaabb54f
commit 50d91144fe
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 6 additions and 0 deletions

View File

@ -257,12 +257,15 @@ void main() {
CategoriesCompanion.insert(description: 'My Initial Description'));
final migrator = db.createMigrator();
await migrator.drop(db.categoryTodoCountView);
await migrator.drop(db.todoWithCategoryView);
await migrator.alterTable(TableMigration(
db.categories,
columnTransformer: {
db.categories.description: db.categories.description.lower(),
},
));
await migrator.recreateAllViews();
final value = await db.categories.select().getSingle();
expect(value.description, 'my initial description');
@ -276,12 +279,15 @@ void main() {
.insertOne(TodosTableCompanion.insert(content: 'my content'));
final migrator = db.createMigrator();
await migrator.drop(db.categoryTodoCountView);
await migrator.drop(db.todoWithCategoryView);
await migrator.alterTable(TableMigration(
db.todosTable,
columnTransformer: {
db.todosTable.content: Variable('old: ') + db.todosTable.content,
},
));
await migrator.recreateAllViews();
final value = await db.todosTable.select().getSingle();
expect(value.content, 'old: my content');