내 프로젝트의 루트 디렉토리에 bay
라는 이름의 사용자 정의 응용 프로그램을 만들 수 있습니다를 실행하지 않는 고정 표시기로, 구조가 보인다장고 사용자 정의 응용 프로그램의 마이그레이션
postgres_1 | ERROR: relation "bay_brand" does not exist at character 13
postgres_1 | STATEMENT: INSERT INTO "bay_brand" ("name") VALUES ('xyz') RETURNING "bay_brand"."id"
따라서, 주어진 모델에 대한 마이그레이션이되지 않았습니다 실행 - 내 사용자 지정 응용 프로그램의 모델 중 하나, 나는 다음과 같은 오류가 발생합니다. 그래서, 난으로 마이그레이션 할 -
은sudo docker-compose -f dev.yml run django python manage.py migrate
가 실행이 있어야 bay.0001_initial
마이그레이션을 표시하지 않습니다
Postgres is up - continuing...
Operations to perform:
Apply all migrations: account, admin, auth, contenttypes, sessions, sites, socialaccount, users
Running migrations:
Applying contenttypes.0001_initial... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0001_initial... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying users.0001_initial... OK
Applying account.0001_initial... OK
Applying account.0002_email_max_length... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying sessions.0001_initial... OK
Applying sites.0001_initial... OK
Applying sites.0002_alter_domain_unique... OK
Applying sites.0003_set_site_domain_and_name... OK
Applying socialaccount.0001_initial... OK
Applying socialaccount.0002_token_max_lengths... OK
Applying socialaccount.0003_extra_data_default_dict... OK
Applying users.0002_auto_20170419_1104... OK
명확 위의 결과있다. 그래서, 내가 가서
Postgres is up - continuing...
Migrations for 'bay':
bay/migrations/0001_initial.py:
- Create model Brand
- Create model ...
- ...
결과
sudo docker-compose -f dev.yml run django python manage.py makemigrations bay
의 출력을보고 내가 다시 migrate
명령을 실행하려고하면, 그것은 No migrations to apply
을 말한다.