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

Issue 51067 create table bug #51069

Closed

Conversation

allisonphillips
Copy link
Contributor

@allisonphillips allisonphillips commented Feb 13, 2024

Warning

Had to submit this in a web editor and realizing my fork is way out of date, will fix the extra commits on here

Solving #51067

I'm only familiar with writing rails tests in rspec, I wrote a test after skimming the other syntax in the file but please let me know if there is a better way.

Motivation / Background

This Pull Request has been created because #51067

Detail

This Pull Request changes create_table to ignore the force option (which drops the table) if the if_not_exists option is present

Additional information

If you copy a create_table migration from a schema dump and add the if_not_exists guard but forget to remove force, it will drop your table when you migrate it.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@allisonphillips
Copy link
Contributor Author

Recreated as #51071

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

Successfully merging this pull request may close these issues.

None yet

1 participant