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

Split primary_keys and sequences cleanups #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nvanoorschot
Copy link
Contributor

I introduced a primary key into my schema with a character varying as datatype but still id as it's name. In order for this to work I had to disable the ignore_ids functionality, which is a shame since that functionality does a good job of cleaning up de sql file.

In order to make it work I separated the logic that handles primary keys from the logic that handles sequences. This allows to have a primary key with any datatype and any column name and still does the cleanup correctly. As a side benefit it now recognizes the primary key of the ar_internal_metadata table, which is named key instead of id.

There's still room for improvement on the sequences bit but that falls outside the scope of this PR.

@andyatkinson
Copy link
Collaborator

@nvanoorschot Is this still a gem you use, and is this PR something you're still interested in? I'm helping maintain the gem now so doing some housekeeping. Thanks.

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

Successfully merging this pull request may close these issues.

3 participants