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

Drop using microseconds for migration versions #52

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

Conversation

ahmadsherif
Copy link

Consider a case where you specify a migration that's was created later as a target (rake db:migrate VERSION=xxxx), for AR to decide whether to migrate up or down, it would get the maximum value found in the schema_migrations table, which would one of the gem's three migration files due to the presence of the extra 6 digits, AR would consider it a down migration, reverting (or dropping!) translation_center tables.

Inhering from ActiveRecord::Generators::Base is preferable because it handles versions conflicts correctly. This leaves us with acts_as_votable migration version conflicts with ours, so we use a little meta-programming (read, hack 😄 ). I removed the sleep(1) call because it's not needed anymore (audited plays nice with the rest), besides, time is of the essence.

Ahmad Sherif added 2 commits October 28, 2013 14:23
Works better with ActiveRecord::Generators::Base and eliminates the need for a sleep call
Copy link

sonarcloud bot commented Nov 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

1 participant