Skip to content

Commit

Permalink
fix(dbfixture): apply cascade option. Fixes #447
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Feb 22, 2022
1 parent 0a4d036 commit d32d988
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dbfixture/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ func (f *Fixture) dropTable(ctx context.Context, table *schema.Table) error {
if _, err := f.db.NewDropTable().
Model(table.ZeroIface).
IfExists().
Cascade().
Exec(ctx); err != nil {
return err
}
Expand All @@ -302,6 +303,7 @@ func (f *Fixture) truncateTable(ctx context.Context, table *schema.Table) error

if _, err := f.db.NewTruncateTable().
Model(table.ZeroIface).
Cascade().
Exec(ctx); err != nil {
return err
}
Expand Down

0 comments on commit d32d988

Please sign in to comment.