mirror of https://github.com/AMT-Cheif/drift.git
Fix tests, which are also failing due to views
This commit is contained in:
parent
c4eaabb54f
commit
50d91144fe
|
@ -257,12 +257,15 @@ void main() {
|
||||||
CategoriesCompanion.insert(description: 'My Initial Description'));
|
CategoriesCompanion.insert(description: 'My Initial Description'));
|
||||||
|
|
||||||
final migrator = db.createMigrator();
|
final migrator = db.createMigrator();
|
||||||
|
await migrator.drop(db.categoryTodoCountView);
|
||||||
|
await migrator.drop(db.todoWithCategoryView);
|
||||||
await migrator.alterTable(TableMigration(
|
await migrator.alterTable(TableMigration(
|
||||||
db.categories,
|
db.categories,
|
||||||
columnTransformer: {
|
columnTransformer: {
|
||||||
db.categories.description: db.categories.description.lower(),
|
db.categories.description: db.categories.description.lower(),
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
|
await migrator.recreateAllViews();
|
||||||
|
|
||||||
final value = await db.categories.select().getSingle();
|
final value = await db.categories.select().getSingle();
|
||||||
expect(value.description, 'my initial description');
|
expect(value.description, 'my initial description');
|
||||||
|
@ -276,12 +279,15 @@ void main() {
|
||||||
.insertOne(TodosTableCompanion.insert(content: 'my content'));
|
.insertOne(TodosTableCompanion.insert(content: 'my content'));
|
||||||
|
|
||||||
final migrator = db.createMigrator();
|
final migrator = db.createMigrator();
|
||||||
|
await migrator.drop(db.categoryTodoCountView);
|
||||||
|
await migrator.drop(db.todoWithCategoryView);
|
||||||
await migrator.alterTable(TableMigration(
|
await migrator.alterTable(TableMigration(
|
||||||
db.todosTable,
|
db.todosTable,
|
||||||
columnTransformer: {
|
columnTransformer: {
|
||||||
db.todosTable.content: Variable('old: ') + db.todosTable.content,
|
db.todosTable.content: Variable('old: ') + db.todosTable.content,
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
|
await migrator.recreateAllViews();
|
||||||
|
|
||||||
final value = await db.todosTable.select().getSingle();
|
final value = await db.todosTable.select().getSingle();
|
||||||
expect(value.content, 'old: my content');
|
expect(value.content, 'old: my content');
|
||||||
|
|
Loading…
Reference in New Issue