Skip to content

Support column sanitisation in partially_delete clauses #1

@urbanautomaton

Description

@urbanautomaton

[This isn't for immediate action - I'm just making a note here so I can follow up later.]

The gem supports a partially_delete option for tables, in which a subset of the table is deleted and the rest retained. The DSL block takes an allow call, and columns are validated in the usual way (i.e. all columns must be explicitly allowed):

partially_delete 'notifications' do
  where notifiable_type: 'Mention'
  allow 'id', 'user_id', 'notifiable_id', 'notifiable_type', 'read_at', 'created_at', 'grouped', 'group_id'
end

Because this block doesn't take a sanitise call, however, it means that partially-deleted tables must have all their columns whitelisted. It might be nice to support delete-then-sanitise. It's taking longer and longer to sanitise the staging DB, so we're likely to want to work with table subsets more in the future.

Metadata

Metadata

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