Add check for existence when creating View

This commit is contained in:
渣渣辉 2022-01-01 19:22:27 +08:00
parent ddede9a8e2
commit e624d4dcca
1 changed files with 1 additions and 1 deletions

View File

@ -326,7 +326,7 @@ class Migrator {
} else if (view.query != null) {
final context = GenerationContext.fromDb(_db);
context.generatingForView = view.entityName;
context.buffer.write('CREATE VIEW ${view.entityName} AS ');
context.buffer.write('CREATE VIEW IF NOT EXISTS ${view.entityName} AS ');
view.query!.writeInto(context);
await _issueCustomQuery(context.sql, const []);
}