Skip to content

[Question] How to replace foreign keys when using limits ? #153

Description

@franck-grenier

Hello,
I tried cloning a database with limits defined on some tables. Now, I would like to replace missing foreign keys.

In details, I have users which can have many articles. If I clone only the last 500 users and the last 1000 articles, I cannot be sure that all articles have an existing user.

I thought this config would do the trick but unfortunately it doesn't:

columns:
      id:
        strategy: remapping
        arguments:
          - use: random_integer
          - foreign_keys:
              - table: articles
                column: user_id
                self_referential: true

How do you handled that ?

Metadata

Metadata

Assignees

No one assigned

    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