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

Cannot delete text plugins or publish CMS pages after upgrading from djangocms-text-ckeditor #60

Open
jasperbok opened this issue Feb 11, 2025 · 3 comments · May be fixed by #61
Open
Labels
good first issue Good for newcomers

Comments

@jasperbok
Copy link

After upgrading an existing project from djangocms-text-ckeditor to djangocms-text, I'm unable to delete text plugins or publish CMS pages containing text plugins. The problem seems to be that the djangocms_text_ckeditor_text table still exists in the database, which has a foreign key to the cms_cmsplugin table.

We didn't encounter this problem during development, as we use sqlite there which doesn't enforce foreign keys by default. On our production environment however, we use PostgreSQL, which does enforce this.

As suggested by @fsbraun in Discord, the straightforward solution seems to be dropping the djangocms_text_ckeditor_text table after upgrading. This should probably be mentioned in the upgrade steps in the readme :)

@fsbraun
Copy link
Member

fsbraun commented Feb 11, 2025

The migration script could delete the unused table, too?

@fsbraun fsbraun added the good first issue Good for newcomers label Feb 11, 2025
@earthcomfy
Copy link

@fsbraun I was thinking of creating a new migration file to handle the table cleanup automatically and then updating the readme to explicitly mention this:

djangocms-text's migrations automatically migrate existing text plugins
from djangocms-text-ckeditor and clean up old tables. All you have to do is:

* uninstall ``djangocms-text-ckeditor``
* remove ``djangocms_text_ckeditor`` from ``INSTALLED_APPS``
* add ``djangocms_text`` to ``INSTALLED_APPS`` (see above)
* run ``python -m manage migrate djangocms_text``

I'm not sure if we want to automatically do this which is why I wanted to run it by you first.

@fsbraun
Copy link
Member

fsbraun commented Feb 17, 2025

@earthcomfy Sounds excellent!

@earthcomfy earthcomfy linked a pull request Feb 18, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants