Skip to content

Add ondelete="CASCADE" to all accounting subscription foreign keys? #83

Open
@Iain-S

Description

@Iain-S

Unless we can think of any good reasons not to, we should probably add ondelete="CASCADE" to the foreign key relationships for status, persistence, usage, etc. the way we do with subscription_details. Without this, you have to delete all of the related records before you can delete a record from accounting.subscriptions.

This is probably not very important in production, since subscriptions won't be deleted often, if ever. However, it should make testing easier.

For the usage table, we would add the ondelete parameter here:

sa.ForeignKeyConstraint(
["subscription_id"],
["accounting.subscription.subscription_id"],
),

as we do here:

sa.ForeignKeyConstraint(
["subscription_id"],
["accounting.subscription.subscription_id"],
ondelete="CASCADE",
),

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions