django-cms / djangocms-moderation

Other
13 stars 20 forks source link

Migration-Error on installing the project #258

Closed wfehr closed 3 months ago

wfehr commented 3 months ago

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 commented 3 months ago

The used database was mysql 8.0.31.

fsbraun commented 3 months ago

@wfehr Would you be interested to test #259 ?

wfehr commented 3 months ago

@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 commented 3 months ago

Great! Thanks for the effort and the feedback!