okfde / froide

Freedom Of Information Portal
MIT License
357 stars 86 forks source link

šŸ› Set confirmation_sent to true for old messaged in db #711

Closed pajowu closed 11 months ago

stefanw commented 11 months ago

I don't understand the change here. This changes a migration to add then alter a field. Why not combine the change into one AddField? It will not run on existing systems that have already applied this migration. Maybe you want a new migrations that alters the default? Or a data migration that sets the field value for older existing rows?

pajowu commented 11 months ago

This migrations is meant to run when the new mail log parser is installed. We need to set confirmation_sent for all previous sent messages, the default was mistakenly set to False, so that we sent out the "Message sent"-E-Mails again. By first adding it with a default of True, we set it for all the previous messages and then change the default in the AlterField step

stefanw commented 11 months ago

Ah, now I get it the meaning of the two operations. However, this change will not affect any system that already applied 0064 (ie. our production system) as the migration will not run again ā€“ the migration system does not detect the change in 0064.

pajowu commented 11 months ago

Yes, iā€™m aware of that. On our production system we already chose another path (setting the flag manually for the old messages), this is meant for other systems migrating now

fin commented 11 months ago

speaking for the other systems: thank you! šŸŽ‰