nephila / djangocms-page-meta

OpenGraph, Twitter Card and Google+ snippet tags for django CMS 3 pages
https://djangocms-page-meta.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
59 stars 64 forks source link

lock auto_field for IDs with AppConfig.default_auto_field #181

Closed wfehr closed 1 year ago

wfehr commented 1 year ago

Problem:

Currently, this project uses BigAutoField for the id-fields of the models.

I assume the migrations are created with the setting DEFAULT_AUTO_FIELD being BigAutoField.

If a project changes this setting, it would result in a missing migration for this project (which I am currently facing :) ).

Solution:

The BigAutoField can be set via AppConfig.default_auto_field.

From the Docs:

By default, Django gives each model an auto-incrementing primary key with the type specified per app in AppConfig.default_auto_field or globally in the ...

protoroto commented 1 year ago

@wfehr Thanks for pointing this out! I've opened a pr with the fix, I hope I can release a new version as soon as possible.

protoroto commented 1 year ago

@wfehr We've just released version 1.4.3 . Check if everything is working as expected now :)

wfehr commented 1 year ago

@wfehr We've just released version 1.4.3 . Check if everything is working as expected now :)

Works as expected - no new migration now.

Thanks!