Integrate to Django through the makemigrations command
See original GitHub issueImprove the linter to integrate directly yo the django makemigrations command.
This way only backward compatible migrations can be generated.
Suggestion of presentation:
makemigrations
0003_auto_1923423432 ...
This migration may not be backwards compatible:
[Show linting errors here]
You can now edit the migration manually and check again. How do you want to proceed?
(1) Check again.
(2) Ignore and proceed.
(3) Delete migration and abort.
One way to integrate it, could be adding the linter to the INSTALLED_APPS
in the Django settings, and then the manage.py makemigrations
would get our custom behaviour.
ping FYI @flixx
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Django App Model - Python manage.py makemigrations ...
makemigrations basically generates the SQL commands for preinstalled apps (which can be viewed in installed apps in settings.py) and your newly ...
Read more >Migrations - Django documentation
Migrations are Django's way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your database schema....
Read more >What are the Django basic app models makemigrations and ...
Makemigrations : This command prepares a makemigrations file for our new model, or creates a new migrations file for any changes if the...
Read more >Django Migrations: A Primer - Real Python
Run ./manage.py migrate to migrate everything or ./manage.py migrate <app_name> to migrate an individual app; Repeat as necessary. That's it! This workflow ...
Read more >A simple script to update a DB migration in Django 1.7+
South had the update flag for the schemamigration command, but I didn't find a similar functionality in the Django builtin makemigrations ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That might work indeed. Thanks for the suggestion @drewbrew
It would not need all the options that are needed to select or unselect migrations, which reduces a lot the scope of needed options. It would mainly need to the options to select/unselect specific things to lint for 🤔 If I have the time, I’ll try to implement a first version of this logic 😃
@drewbrew thanks for following the issue 😃
It tooks some time to really get into it, but it should work fine now. I’ll try to release a new version of the linter with the command in the next days. Don’t hesitate to open an issue if something is not working correctly or could be improved. We can always iterate of the first approach taken 😃