-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: add migration to remove old ckeditor table #61
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request adds a migration to remove the old No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @earthcomfy - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a comment to explain why the table needs to be dropped.
- It might be safer to check if the table exists within the
drop_table_if_exists
function usingapps.get_model
rather than relying onschema_editor.connection.introspection.table_names()
.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
README.rst
Outdated
@@ -59,7 +59,7 @@ Upgrading from djangocms-text-ckeditor | |||
-------------------------------------- | |||
|
|||
djangocms-text's migrations automatically migrate existing text plugins | |||
from djangocms-text-ckeditor. All you have to do is: | |||
from djangocms-text-ckeditor and clean up old tables. All you have to do is: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (typo): Add a comma after 'djangocms-text-ckeditor'.
The sentence would read better with a comma after 'djangocms-text-ckeditor'.
from djangocms-text-ckeditor and clean up old tables. All you have to do is: | |
from djangocms-text-ckeditor, and clean up old tables. All you have to do is: |
I used schema_editor because it provides a Django-agnostic way to manage database schema changes. Also, the previous migration file uses it. |
HI there, My concern is that it automatically drops the tables. |
@DmytroLitvinov I brought this idea in the issue and thought we wanted to move forward with this approach. @fsbraun |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61 +/- ##
==========================================
- Coverage 81.63% 81.30% -0.34%
==========================================
Files 17 18 +1
Lines 942 952 +10
Branches 105 107 +2
==========================================
+ Hits 769 774 +5
- Misses 130 135 +5
Partials 43 43 ☔ View full report in Codecov by Sentry. |
@DmytroLitvinov Any regular migration would replace the old model by the new one retaining already existing data (if possible). This is also the case for this migration. I would second adding it. (Thanks, @earthcomfy ) It might be worthwhile mentioning that one can avoid the old tables to be dropped if migrations are run up to |
@earthcomfy Why is the |
@fsbraun I tested this by creating a test project inside my branch. I first added I also tested this both with sqlite and postgres. I added cascade because of the description mentioned in the issue. In PostgreSQL, to drop a table that is referenced by a view or a foreign-key constraint of another table, we have to use cascade. That is my thought process. |
This PR attempts to add a migration file to remove the old ckeditor table.
Fixes #60
Summary by Sourcery
Bug Fixes: