PostgreSQL
 SQL >> Base de données >  >> RDS >> PostgreSQL

Recreating une table supprimée avec les migrations Django

Sous Django 1.7, vous pouvez essayer :

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 

Si vous êtes sur Django 1.9.5, voici une solution à 100 % au problème :

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 

Cela a fonctionné à 100 % à chaque fois pour moi.