PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

Come ricreare una tabella eliminata con Django Migrations?

In django 1.7 puoi provare:

1. Delete your migrations folder

2. In the database: DELETE FROM django_migrations WHERE app = 'app_name'.
   You could alternatively just truncate this table.

3. python manage.py makemigrations

4. python manage.py migrate --fake

Se stai lavorando con django 1.9.5 questa è la soluzione al 100% per questo problema:

1. Delete your migrations folder

2. In the database: DELETE FROM django_migrations WHERE app = 'app_name'.
   You could alternatively just truncate this table.

3. python manage.py makemigrations app_name

4. python manage.py migrate

Funziona al 100% per me!