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

Added ability to set uuid as item_id type while generating migration #1374

Merged
merged 9 commits into from
Mar 9, 2022

Conversation

Nuzair46
Copy link
Contributor

@Nuzair46 Nuzair46 commented Feb 17, 2022

Added option --uuid when generating new migration. This can be used to set the type on item_id column to uuid.

Use case:

  • If a user uses paper_trail on a database that uses uuid as primary key, there is a chance where item_id becomes 0 causing the versioning to not work. Changing the type of item_id from bigint to string fixes this issue.
  • This PR makes it possible for the user to use uuid while generating the migration.
bin/rails generate paper_trail:install [--uuid]

Thank you for your contribution!

Check the following boxes:

  • Wrote good commit messages.
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new
    code introduces user-observable changes.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.

@Nuzair46 Nuzair46 marked this pull request as ready for review February 17, 2022 11:49
Copy link
Member

@jaredbeck jaredbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Nuzair! Generally this looks good, just a few minor comments.

Also, please update the install documentation in the README.

CHANGELOG.md Outdated Show resolved Hide resolved
spec/generators/paper_trail/install_generator_spec.rb Outdated Show resolved Hide resolved
@Nuzair46
Copy link
Contributor Author

Nuzair46 commented Mar 9, 2022

@jaredbeck , Suggested changes are made. Please review. Thanks.

closes #1373

@jaredbeck jaredbeck merged commit 81f935f into paper-trail-gem:master Mar 9, 2022
@jaredbeck
Copy link
Member

Thanks for the contribution!

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

Successfully merging this pull request may close these issues.

2 participants