-
Notifications
You must be signed in to change notification settings - Fork 28
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
"Migrations are pending" popup is too aggressive #540
Comments
Hi Matt, thank you for the suggestion. We will consider some options for this. |
@swanson We discussed as a team and are considering this approach: We won't prompt to run the migrations if the most recent migration is empty. A migration would be considered empty if it has no methods:
or if it contains only a timestamp column (which the generator may add by default).
If were were do this, I don't think we wouldn't need an option to disable the popup. The only downside I can think of is if you save the migration mid-way through writing it, then it would trigger the popup. Any thoughts? |
If I run the output is
so I don't think that would solve my particular issue because the LSP would not consider that empty, correct? |
Maybe "smart detection of empty migrations" is not the right solution, but it does seem like people (myself included) will want a way to turn off this popup, as it is pretty invasive if you aren't using it. The Rails "run pending migration" button is also an option so I don't believe this functionality is novel enough to be "always on". |
We can have it treat that as empty too. |
I often am running
bin/rails g migration SomeMigration
to get a blank migration and then writing it my editor instead of the generator. When I do this, the "Migrations are pending" popup immediately displays and asks me to run the (empty) migration.From my perspective:
I think this has the potential for people to run the empty migration without realizing it ("I just click that button always") and then write the actual migration code and be confused why the changes don't seem to work (migration was marked as run so it doesnt re-run)
The text was updated successfully, but these errors were encountered: