Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the last migration

Tags:

django

In django, we can write '__first__' to specify the first migration dependency

dependencies = [
    ('auth', '__first__'),
]

Is there a way to get the last?
Something like '__last__' ?

Thanks

like image 341
brunofitas Avatar asked Apr 02 '15 15:04

brunofitas


People also ask

How do I revert to previous migration Entity Framework?

Reverting a Migration But, for some reason, you want to revert the database to the previous state. In this case, use the update-database <migration name> command to revert the database to the specified previous migration snapshot.

How do I apply for migration?

The EF command-line tools can be used to apply migrations to a database. While productive for local development and testing of migrations, this approach isn't ideal for managing production databases: The SQL commands are applied directly by the tool, without giving the developer a chance to inspect or modify them.


1 Answers

Yes, there is.

It's name is __latest__.

Example:

dependencies = [
    ('auth', '__latest__'),
]
like image 84
Omid Raha Avatar answered Oct 03 '22 18:10

Omid Raha