#27892: Independent migrations
------------------------------+----------------------------------------
     Reporter:  ChillarAnand  |                    Owner:  ChillarAnand
         Type:  New feature   |                   Status:  assigned
    Component:  Migrations    |                  Version:  master
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+----------------------------------------

Comment (by ChillarAnand):

 This migration is temporary. It is better not to use `dependencies` as it
 becomes a problem when removing if new migrations pile up.

 `run_before` doesn't seem to work as expected in this case.

 {{{
     run_before = [
         ('book', '0001_initial'),
     ]
 }}}

 `makemigrations` fails with

 {{{
 Traceback (most recent call last):
   File "manage.py", line 22, in <module>
     execute_from_command_line(sys.argv)
   File
 "/home/chillaranand/projects/django/django/core/management/__init__.py",
 line 354, in execute_from_command_line
     utility.execute()
   File
 "/home/chillaranand/projects/django/django/core/management/__init__.py",
 line 348, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File
 "/home/chillaranand/projects/django/django/core/management/base.py", line
 280, in run_from_argv
     self.execute(*args, **cmd_options)
   File
 "/home/chillaranand/projects/django/django/core/management/base.py", line
 327, in execute
     output = self.handle(*args, **options)
   File
 
"/home/chillaranand/projects/django/django/core/management/commands/makemigrations.py",
 line 93, in handle
     loader.check_consistent_history(connection)
   File
 "/home/chillaranand/projects/django/django/db/migrations/loader.py", line
 293, in check_consistent_history
     connection.alias,
 django.db.migrations.exceptions.InconsistentMigrationHistory: Migration
 book.0001_initial is applied before its dependency book.unaccent on
 database 'default'.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27892#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.81d6fb6822433684b9cdb9f618b7beae%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to