Changes between Initial Version and Version 3 of Ticket #24543


Ignore:
Timestamp:
Mar 27, 2015, 7:15:12 AM (9 years ago)
Author:
Tim Graham
Comment:

As for me, I simply execute migrate as part of a deployment script. If there aren't any migrations to apply, it's just a no-op. Could you elaborate on your use case for needing to know if migrations are applied or not? Currently, check --deploy is simply a static analysis of a settings file. The check you proposed would require the ability to connect to the production database which might not be possible from a development machine.

Regarding the second point, makemigrations gained an --exit option in 1.8 which does what you describe.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24543

    • Property Owner nobody removed
  • Ticket #24543 – Description

    initial v3  
    11The `runserver` command prints a notice in case migrations are not applied:
    2 
     2{{{
    33    def check_migrations(self):
    44        """
     
    1111            self.stdout.write(self.style.NOTICE("\nYou have unapplied migrations; your app may not work properly until they are applied."))
    1212            self.stdout.write(self.style.NOTICE("Run 'python manage.py migrate' to apply them.\n"))
    13 
     13}}}
    1414
    1515I would like to use this test during deployment.
Back to Top