drop method
Drops a table, trigger or index.
Implementation
Future<void> drop(DatabaseSchemaEntity entity) async {
final escapedName = escapeIfNeeded(entity.entityName);
String kind;
if (entity is TableInfo) {
kind = 'TABLE';
} else if (entity is Trigger) {
kind = 'TRIGGER';
} else if (entity is Index) {
kind = 'INDEX';
} else if (entity is ViewInfo) {
kind = 'VIEW';
} else {
// Entity that can't be dropped.
return;
}
await _issueCustomQuery('DROP $kind IF EXISTS $escapedName;');
}