lqez / django-summernote

Simply integrate Summernote editor with Django project.
MIT License
1.04k stars 227 forks source link

docker-compose migration alerts lack of migration 0003 #503

Open GuiFV opened 6 months ago

GuiFV commented 6 months ago

When I run docker-compose run web python manage.py migrate I get this message:

_Your models in app(s): 'djangosummernote' 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.

Running docker-compose run web python manage.py makemigrations alerts that the file was created (0003_alter_attachment_id.py) but migrating again returns the same above message.

PS: on virtual environment everything runs fine with no issues.

pip-install-python commented 4 months ago

Hey GuiFV,

Ran into the same issue, and it was driving me crazy, finally found the solution from looking through the work of @ethanhann and @alexdeathway.

What I did to fix the issue was pip uninstall django-summernote, then I went into my requirements.txt and replaced django_summernote with git+https://github.com/ethanhann/django-summernote.git@bug/0003_alter_attachment_id_does_not_exists and ran a pip install git+https://github.com/ethanhann/django-summernote.git@bug/0003_alter_attachment_id_does_not_exists just to be sure.

In my docker file I had to make sure I had git installed, which I added after my apt-git / psycopg setup:

# Install apt packages
RUN apt-get update && apt-get install --no-install-recommends -y \
  # dependencies for building Python packages
  build-essential \
  # psycopg dependencies
  libpq-dev \
  # git for pip install
  git

Hope this helps anyone facing the same issues, django-summernote is a great tool for django. Hopeful we can find maintainers

GuiFV commented 4 months ago

Thank you @pip-install-python ! I will check the solution out. Would be great to have these small fixes on the main branch (leaving this for dev/maintenance team)