Open wajeshubham opened 9 months ago
Hi @wajeshubham, I've tried to replicate this problem and not having much luck. Did you happen to upgrade django at the same time? There wasn't any changes made to the models in the version just released, but because the migrations are trying to update the id field makes me think it might have something to do with the default auto field setting? https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
Ahh! I see.
Thanks for your prompt response @seb-b . Yes, this problem persisted when I added wagtailvideos field in one of m y models, I understand your point regarding the possibility that this issue might be related to Django's default auto field setting. However, in my case, altering the default auto field setting isn't a viable option, as my project relies on dynamically creating primary keys for all the models.
Considering this, I'm curious if there's a workaround or solution that can be implemented within the wagtailvideos
package itself. This would ideally address the migration dependencies without requiring significant changes to the existing Django settings or model configurations in projects that use wagtailvideos.
Is there a way we can ensure that the migrations within wagtailvideos
are compatible with the dynamic creation of primary keys, as necessitated by the recent Django versions? Any guidance or alternative solutions you can provide would be greatly appreciated, as this seems to be a critical issue affecting the integration of wagtailvideos
in projects with similar configurations.
Looking forward to your suggestions or insights on this matter. Cheers! :-D
@wajeshubham , I've just released version 5.2.1 with a possible fix, can you let me know if makemigrations
still attempts to create a migration for wagtailvideos?
Issue Description
When installing the latest version of
wagtailvideos
, the package appears to be missing necessary migrations for the updated models. This leads to issues in generating new migrations in projects that depend onwagtailvideos
.Specifically, when running
python manage.py migrate
, it results in aNodeNotFoundError
due to a missing migration dependency.Steps to Reproduce
wagtailvideos
.wagtailvideos
. (After adding video field in one of my app's models)python manage.py makemigrations
.python manage.py migrate
.Expected Behavior
The migration process should complete without errors, with all dependencies correctly resolved.
Actual Behavior
The migration process fails with the following error:
Additional Information
Below is the generated migration file that causes the issue:
This issue indicates that the migration
0015_alter_tracklisting_id_alter_video_id_and_more
is either missing or not pushed to the repository.⁉️ Following way make it work (not sure if this is a correct way. LMK)
Updating the above migration file by changing
wagtailvideos
dependency as follows will resolve the issue0014_alter_videotrack_file_alter_videotrack_kind_and_more
being the latest migrations file fromwagtailvideos
package.Suggested Fix
Please review the recent model changes in
wagtailvideos
and ensure that all necessary migrations are included in the package and pushed to the repository.Environment