mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Check if table still exists before auto-dropping columns
This commit is contained in:
@@ -276,7 +276,7 @@ export class FieldsService {
|
||||
|
||||
await this.knex('directus_fields').delete().where({ collection, field });
|
||||
|
||||
if (field in this.schema.tables[collection].columns) {
|
||||
if (this.schema.tables[collection] && field in this.schema.tables[collection].columns) {
|
||||
await this.knex.schema.table(collection, (table) => {
|
||||
table.dropColumn(field);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user