openwisp-utils icon indicating copy to clipboard operation
openwisp-utils copied to clipboard

[qa] Simplify migration checks

Open nemesifier opened this issue 5 years ago • 2 comments

We currently have two migration checks:

  • one checks whether there are pending migrations to create (./manage.py makemigrations --dry-run)
  • one checks whether the names of the migration files have auto in them

The problem is that we have to specify both --migration-module and --migration-path. I think we can avoid doing this and have only one command line flag.

I would get rid of --migration-path, keeping only --migration-module, although I would rename this flag to --migration-modules while keeping backward compatibility with the old flag.

--migration-path should be ignored (printing a deprecation warning).

We will need to upgrade the modules using this: https://github.com/search?q=org%3Aopenwisp+%27--migration-path%27&type=Code

nemesifier avatar May 20 '20 00:05 nemesifier

@atb00ker @ppabcd do you see any issues in this?

nemesifier avatar May 20 '20 00:05 nemesifier

I don't see an issues, all migrations are in the migrations/ folder and the script can look for that folder name to find the migrations! :smile:

atb00ker avatar May 22 '20 12:05 atb00ker