본문 바로가기
파이썬

[django]"django_content_type" already exists 에러 발생시

by 김수호님 2019. 4. 17.
728x90
반응형

python manage.py migrate 뒤에 --fake-initial 옵션을 붙여주면 된다. 

-> python manage.py migrate --fake-initial

 

--fake-initial이란?

The --fake-initial option can be used to allow Django to skip an app’s initial migration if all database tables with the names of all models created by all CreateModel operations in that migration already exist. This option is intended for use when first running migrations against a database that preexisted the use of migrations. This option does not, however, check for matching database schema beyond matching table names and so is only safe to use if you are confident that your existing schema matches what is recorded in your initial migration.

 

DB가 이미 생성되어있으면(테이블명 등 일치) migration을 하지 않는다.

728x90
반응형