Skip to content

Commit

Permalink
fix: fix delete base
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Nov 7, 2024
1 parent 2004b57 commit 7e18506
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/persistence/src/base/base.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,29 @@ export class BaseRepository implements IBaseRepository {
.where((eb) => eb.eb("table_id", "in", tableIds))
.execute()

await trx
.deleteFrom("undb_dashboard_table_id_mapping")
.where((eb) => eb.eb("table_id", "in", tableIds))
.execute()

await trx
.deleteFrom("undb_attachment_mapping")
.where((eb) => eb.eb("table_id", "in", tableIds))
.execute()

await trx
.deleteFrom("undb_webhook")
.where((eb) => eb.eb("table_id", "in", tableIds))
.execute()

await trx
.deleteFrom("undb_dashboard")
.where((eb) => eb.eb("base_id", "=", id))
.execute()

await trx
.deleteFrom("undb_table")
.where((eb) => eb.eb("id", "in", tableIds))
.where((eb) => eb.eb("base_id", "=", id))
.execute()

await trx
Expand Down

0 comments on commit 7e18506

Please sign in to comment.