Skip to content

Migration Error for FilePathField MEDIA_DIR #4

@gregWDumont

Description

@gregWDumont

Description:
When running the command python manage.py migrate, an issue is encountered during migrations. The error message suggests that there are changes in the models of the 'elearning' app that are not yet reflected in a migration.

Steps to Reproduce:

  1. Run python manage.py migrate in the project directory.

Expected Behavior:
All migrations should be applied successfully without any errors.

Actual Behavior:
The migration process fails with the following error message:

Operations to perform:
  Apply all migrations: admin, auth, contenttypes, elearning, sessions, sites
Running migrations:
  No migrations to apply.
  Your models in app(s): 'elearning' have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

Additional Information:
The issue seems to be related to a FilePathField defined with recursive=True in the 'elearning' app's models.

Resolution:
To resolve this issue, follow these steps:
Investigate in the Django docs how to find a solution (absolute or relative path): https://docs.djangoproject.com/en/5.0/ref/models/fields/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions