django_evolution.mutations.move_to_django_migrations

Mutation that moves an app to Django migrations.

New in version 2.2.

Classes

MoveToDjangoMigrations([mark_applied])

A mutation that uses Django migrations for an app's future upgrades.

class django_evolution.mutations.move_to_django_migrations.MoveToDjangoMigrations(mark_applied=['0001_initial'])

Bases: BaseUpgradeMethodMutation

A mutation that uses Django migrations for an app’s future upgrades.

This directs this app to evolve only up until this mutation, and to then hand any future schema changes over to Django’s migrations.

Once this mutation is used, no further mutations can be added for the app.

Changed in version 2.2: Moved into the django_evolution.mutations.move_to_django_migrations module.

__init__(mark_applied=['0001_initial'])

Initialize the mutation.

Parameters:

mark_applied (unicode, optional) – The list of migrations to mark as applied. Each of these should have been covered by the initial table or subsequent evolutions. By default, this covers the 0001_initial migration.

generate_dependencies(app_label, **kwargs)

Return automatic dependencies for the parent evolution.

This will generate a dependency forcing this evolution to apply before the migrations that are marked as applied, ensuring that subsequent migrations are applied in the correct order.

New in version 2.1.

Parameters:
  • app_label (unicode) – The label of the app containing this mutation.

  • **kwargs (dict) – Additional keyword arguments, for future use.

Returns:

A dictionary of dependencies. This may have zero or more of the following keys:

  • before_migrations

  • after_migrations

  • before_evolutions

  • after_evolutions

Return type:

dict

simulate(simulation)

Simulate the mutation.

This will alter the app’s signature to mark it as being handled by Django migrations.

Parameters:

simulation (Simulation) – The simulation being performed.