Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only add keys where no orphan records exist #34

Open
samjewell opened this issue Oct 5, 2020 · 0 comments
Open

Only add keys where no orphan records exist #34

samjewell opened this issue Oct 5, 2020 · 0 comments

Comments

@samjewell
Copy link

samjewell commented Oct 5, 2020

I love using this gem - thank you everyone for writing and maintaining it. I have a feature request: Could we [optionally] only generate foreign-key migrations where no foreign keys are present? Then I could run

DATABASE_URL=[production_database_url] rails generate immigration AddKeys omit_when_orphans_present

I would have certainty that I could apply the migration without breaking our main build and release process (and other migrations queued up behind mine, that my team-members are trying to run). And I'd then be able to run:
rails g immigration AddRemainingKeys afterwards to see the keys where I need to address the orphan records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant