Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration-Error on installing the project #258

Closed
wfehr opened this issue Mar 11, 2024 · 4 comments · Fixed by #259
Closed

Migration-Error on installing the project #258

wfehr opened this issue Mar 11, 2024 · 4 comments · Fixed by #259

Comments

@wfehr
Copy link

wfehr commented Mar 11, 2024

Error occured when trying to install the project with cms-4.1 and django-4.2 (see #256).

Also with django-4.1 this installation doesn't work.

Part of the trace:

File "/usr/local/lib/python3.11/site-packages/django/db/models/fields/init.py", line 925, in get_db_prep_save
return self.get_db_prep_value(value, connection=connection, prepared=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django/db/models/fields/init.py", line 2704, in get_db_prep_value
value = connection.ops.validate_autopk_value(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django/db/backends/mysql/operations.py", line 250, in validate_autopk_value
raise ValueError(
ValueError: The database backend does not accept 0 as a value for AutoField.

Relevant migration: djangocms_moderation.0003_auto_20180903_1206
There, a one-off-default of 0 for a new ForeignKey was set.

@wfehr
Copy link
Author

wfehr commented Mar 11, 2024

The used database was mysql 8.0.31.

@fsbraun
Copy link
Member

fsbraun commented Mar 11, 2024

@wfehr Would you be interested to test #259 ?

@wfehr
Copy link
Author

wfehr commented Mar 12, 2024

@wfehr Would you be interested to test #259 ?

Was hard to try out with my local setup and moderation currently not supporting django 4.2.
Installations with cms=4.0.1.x and trying django 4.0+ didn't work either.

But I installed it with the following:

-> Worked and migrations ran successfully!

@fsbraun
Copy link
Member

fsbraun commented Mar 12, 2024

Great! Thanks for the effort and the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants