Pavel Antspovich
Pavel Antspovich

Reputation: 1221

Could not add new columns to model

I'm using PostegreSQL. What I've tryed already:

python manage.py flush
python manage.py makemigrations
python manage.py migrate
python manage.py makemigrations app
python manage.py migrate app
python manage.py migrate --run-syncdb

There aren't any effect. The table have no recently added columns. Have no importaint data in tables, can remove it.

Upvotes: 0

Views: 286

Answers (2)

vojtos
vojtos

Reputation: 102

  1. Remove all DB tables.
  2. Remove all migration files from migrations directory.
  3. python manage.py makemigrations
  4. python manage.py migrate

Upvotes: 1

JayBee
JayBee

Reputation: 540

Delete all migration files (except the init.py files) and database, rerun makemigrations and migrate.

Upvotes: 1

Related Questions