mirror of https://github.com/AMT-Cheif/drift.git
Add check for existence when creating View
This commit is contained in:
parent
ddede9a8e2
commit
e624d4dcca
|
@ -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 []);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue