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

Compute Migration Number Using Rails' Internals #3

Open
swiknaba opened this issue Nov 2, 2021 · 0 comments
Open

Compute Migration Number Using Rails' Internals #3

swiknaba opened this issue Nov 2, 2021 · 0 comments

Comments

@swiknaba
Copy link
Contributor

swiknaba commented Nov 2, 2021

https://github.com/dbl-works/checker/blob/main/lib/generators/dbl_checker/install_generator.rb#L11

replace hack

migration_version = `bundle exec rails g migration CreateDblChecks`[/db\/migrate\/(\d+)_/, 1]

with

ActiveRecord::Migration.next_migration_number(Kernel.rand(0..99))

see: https://apidock.com/rails/v6.1.3.1/ActiveRecord/Migration/next_migration_number

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