Pil
Pil

Reputation: 31

south. migrate entire database

how can i migrate entiry db at one step? south`s startmigration command can work only with single application

Upvotes: 3

Views: 540

Answers (2)

Daisy Leigh Brenecki
Daisy Leigh Brenecki

Reputation: 7931

If you want to create a migration, manage.py startmigration is deprecated (see manage.py help startmigration), you should be using manage.py schemamigration (as described in the docs), and you should definitely be doing this individually on each app.

If you want to run migrations (in other words do the actual altering of the database, which I'm guessing is the case), The command for that is manage.py migrate which, if run without any arguments, will migrate all of your apps to the latest migration available.

My deployment script just has manage.py migrate, and it works fine without manual intervention, no matter how many apps have new migrations that need to be run.

Upvotes: 4

googletorp
googletorp

Reputation: 33265

Even with raw SQL, you wont be able to migrate an entire database in a single step as you need a query per table. You can however, create migrations for all apps, and then run them all at once. That's the closest thing you'll come to a one step migration.

Upvotes: 3

Related Questions