isso: migrate: Handle deleted comments in Disqus migration#994
Conversation
|
please complete the checklist in the PR template |
|
Thank you for the review. |
|
I don't have much background on disqus, but what's the point of still importing these comments but then making isso ignore them? Couldn't we just filter out the deleted comments during import or is there some point in keeping them? |
|
During migration, deleted comments are ignored if they have no child comments. |
|
Is setting the comment text to null the right thing to do in that case though, or we just set it to an empty string at import time (and change the schema to disallow null) ? |
|
In the main scenario, if a comment needs to be marked as deleted and not removed from the database, its text is set to an empty string. Line 285 in fc0641f But in the Disqus migration |
|
Right, what I'm saying is - why not fix this in the disqus migration by having it set message to an empty string when it is null? |
|
Sorry if I misunderstood you, but that's what I made the changes to |
Yeah, it's the change in html.py that I'm objecting to. We should rather just initialize the database to mandate that text can't be null rather than adjusting the application to cope with it. |
That's a good point, thank you. |
That'd be a nice addition (in isso/db.py) but I don't think it's strictly necessary |
|
Apologies for the late comment. It appears to me that since this PR changes the DB schema in 6dffaa7#diff-115e97a46b3ca0f35e7455d6e624550eff6fe684c3354f42545d06b874eba433R41 we ought to update the internal database version and add a migration clause: Lines 66 to 123 in 6dffaa7 |
|
@ix5 |
Yes please! |
…migration This update introduces a schema migration to version 4 for the database, focusing on enhancing the 'comments' table. This ensures that the 'text' field in the 'comments' table will always have a value, which improves data consistency and integrity. See: - isso-comments#979 - isso-comments#994
…migration This update introduces a schema migration to version 4 for the database, focusing on enhancing the 'comments' table. This ensures that the 'text' field in the 'comments' table will always have a value, which improves data consistency and integrity. See: - isso-comments#979 - isso-comments#994
…migration This update introduces a schema migration to version 4 for the database, focusing on enhancing the 'comments' table. This ensures that the 'text' field in the 'comments' table will always have a value, which improves data consistency and integrity. See: - isso-comments#979 - isso-comments#994
…migration This update introduces a schema migration to version 4 for the database, focusing on enhancing the 'comments' table. This ensures that the 'text' field in the 'comments' table will always have a value, which improves data consistency and integrity. See: - isso-comments#979 - isso-comments#994
…migration This update introduces a schema migration to version 4 for the database, focusing on enhancing the 'comments' table. This ensures that the 'text' field in the 'comments' table will always have a value, which improves data consistency and integrity. See: - isso-comments#979 - isso-comments#994
…migration This update introduces a schema migration to version 4 for the database, focusing on enhancing the 'comments' table. This ensures that the 'text' field in the 'comments' table will always have a value, which improves data consistency and integrity. See: - isso-comments#979 - isso-comments#994
Checklist
What changes does this Pull Request introduce?
isso/migrate.py: Improved handling of deleted comments during Disqus migration by ensuring that deleted comments are imported with an empty message text, enhancing the robustness of the migration process.isso/utils/html.py: Add conditional check forNonebefore Markdown conversion in HTML utility, improving the system's resilience to null input values.Why is this necessary?
Fixes #979