Skip to content

Paranoid / discard gem compatibility: preserve deleted_at / discarded_at verbatim through staging #39

@sncalvo

Description

@sncalvo

Problem

Soft-delete gems (paranoia, discard) store a deleted_at or discarded_at timestamp. When a source contains soft-deleted rows and we stage them, the gem should preserve the column verbatim — but should not trigger the gem's "hide deleted rows" behavior during staging queries (since users often want to see them in staging to decide what to do).

Proposal

  • Document that deleted_at / discarded_at columns are carried through transfer verbatim (they're just regular columns to StagingTable, which is correct)
  • Provide an include_soft_deleted: true helper for the model-scoping issue (staging User.all bypassing default_scope { where(deleted_at: nil) })
  • Add a test case that soft-deleted rows are preserved through a full upsert

Acceptance criteria

  • Paranoia/discard integration test passes
  • README has a note under model-scoping about soft-delete gems
  • No surprise interactions with extra_columns

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions