Project

Profile

Help

Issue #3012

closed

db-reset script fails to migrate

Added by amacdona@redhat.com about 7 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Dev Environment
Sprint:
Sprint 25
Quarter:

Description


Operations to perform:
  Apply all migrations: auth
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
[jortel@f25a app]$ python3 manage.py migrate --noinput
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
  Applying admin.0001_initial...Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: relation "pulp_app_user" does not exist
remove the migrations directory for each app

Workaround:

First remove the migrations at `pulp_file/app/migrations/` and `platform/pulcore/app/migrations/`
Then create new migrations explicitly and migrate (order is important).

python manage.py reset_db
python manage.py makemigrations pulp_file
python manage.py makemigrations pulp_app
python manage.py migrate auth
python manage.py migrate pulp_file
python manage.py migrate

Also available in: Atom PDF