mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix collection delete for collections w/ m2o to them (#5809)
* Fix new-collection relational field creation * Fix collection delete for collections w/ m2o to them Fixes #5793
This commit is contained in:
@@ -378,7 +378,7 @@ export class FieldsService {
|
||||
// Cleanup directus_fields
|
||||
const metaRow = await trx.select('id').from('directus_fields').where({ collection, field }).first();
|
||||
|
||||
if (metaRow.id) {
|
||||
if (metaRow?.id) {
|
||||
// Handle recursive FK constraints
|
||||
await trx('directus_fields').update({ group: null }).where({ group: metaRow.id });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user