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

Test migrations reverse cleanly #1180

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DanielHeath
Copy link
Contributor

Initial cut at the check mentioned in
#1161 (comment)

@bensheldon
Copy link
Owner

Do you think you could fit this test into the existing generators spec? I worry about my ability to maintain a shell script. Here's an example:

it 'produces an idempotent schema.rb when run with install generator' do

@DanielHeath
Copy link
Contributor Author

Shouldn't be too hard to port - I just grabbed the one I already had written.

@DanielHeath
Copy link
Contributor Author

Oh, actually - the test suite will be holding an open database connection, so you can't drop/recreate the database.

@bensheldon
Copy link
Owner

hmmm, I think it might be possible to disconnect! the current connection(s):

ApplicationRecord.connection_handler.clear_active_connections!
ApplicationRecord.connection_pool.disconnect

I dunno if that's enough though to fully drop the database 🤞🏻

@DanielHeath
Copy link
Contributor Author

Yeah, likely possible. I probably won't get to look at this in detail until... [checks calendar] early Feb

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

Successfully merging this pull request may close these issues.

None yet

2 participants