django-cms / djangocms-style

django CMS Style is a plugin for django CMS that allows you to create a HTML container containing classes, styles, ids and other attributes.
https://marketplace.django-cms.org/en/addons/browse/djangocms-style/
Other
38 stars 22 forks source link

[BUG] Missing migrations for cmsplugin_ptr #62

Open jribbens opened 9 months ago

jribbens commented 9 months ago

Description

djangocms 3.11.4 is missing migrations for plugins.

Steps to reproduce

  1. Install e.g. djangocms 3.11.0 with django 4.0
  2. Create a new project and add django cms to the INSTALLED_APPS as per the instructions
  3. Install a plugin, e.g. djangocms_column, djangocms_googlemap, djangocms_picture, djangocms_style, or djangocms_video
  4. Run ./manage.py migrate
  5. Run pip install -U django-cms
  6. Run ./manage.py makemigrations and notice that there are missing migrations for every plugin

Expected behaviour

Migrations are part of the packages.

Actual behaviour

Migrations are missing.

Screenshots

Example missing migration for cmsplugin_style:

Migrations for 'djangocms_style': 
  env/lib/python3.10/site-packages/djangocms_style/migrations/0008_alter_style_cmsplugin_ptr.py
    - Alter field cmsplugin_ptr on style                                        
Full migrations file '0008_alter_style_cmsplugin_ptr.py':                       
# Generated by Django 4.2.5 on 2023-09-26 12:31                                 

from django.db import migrations, models                                        
import django.db.models.deletion                                                

class Migration(migrations.Migration):                                          

    dependencies = [                                                            
        ('cms', '0022_auto_20180620_1551'),                                     
        ('djangocms_style', '0007_style_template'),                             
    ]                                                                           

    operations = [
        migrations.AlterField(
            model_name='style',
            name='cmsplugin_ptr',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='%(app_label)s_%(class)s', serialize=False, to='cms.cmsplugin'),
        ),
    ]

Do you want to help fix this issue?

fsbraun commented 9 months ago

@jribbens would you be interested in adding support for Django 4+ to djangocms-style? This would require updating test requirements, adjusting Django version-specific code ( largely automated with Django-upgrade) and updating readme and setup.py?