No cascade delete between TrialAccount and BililngAccount
The Cleanup service raises the following exception: ``` PG::ForeignKeyViolation: ERROR: update or delete on table "billing_accounts" violates foreign key constraint "fk_rails_5fb637c090" on table "trial_accounts" DETAIL: Key (id)=(684553) is still referenced from table "trial_accounts". ``` Such error happens because there is no option defined on the foreign key between tables `billing_accounts` and `trial_accounts` but we have defined 1-to-many relationship between `BillingAccount` and `TrialAccount`. ## Proposal 1. Define the `has_many` relation on the `BillingAccount` model to explicitly define the mentioned relation. 2. Modify the foreign key to allow cascading deletes.
issue