[19.0][OU-ADD] event: slots + question m2m promotion#5637
Conversation
7ab2ce2 to
753bcc9
Compare
753bcc9 to
496a78a
Compare
496a78a to
0034427
Compare
| NEW event.question: event.event_question_email (noupdate) | ||
| NEW event.question: event.event_question_name (noupdate) | ||
| NEW event.question: event.event_question_phone (noupdate) | ||
| DEL event.stage: event.event_stage_cancelled (noupdate) |
There was a problem hiding this comment.
You need to manually delete this noupdate stage (or explain why you prefer to keep it (and if this is the case you probably need to remove the XML-id from that stage))
There was a problem hiding this comment.
Done in 22c419b — pre-migration deletes the noupdate event_stage_cancelled record via direct SQL.
| # DONE: event.question.event_id / event_type_id m2o->m2m promotion handled by | ||
| # pre-migration rename_columns (preserve as legacy) + post-migration INSERTs | ||
| # into event_event_event_question_rel and event_question_event_type_rel. | ||
| # Reverse o2m->m2m on event.event.question_ids (and siblings) and | ||
| # event.type.question_ids reads from the same m2m tables — no extra work. | ||
| # All NEW fields are additive (defaults / compute). Selection key changes | ||
| # additive or shrink — pedrobaeza: leave residuals to database_cleanup. |
There was a problem hiding this comment.
You need to put comments only related to specific lines that need upgrade script, the other ones should be marked as # NOTHING TO DO
There was a problem hiding this comment.
Restructured in 22c419b — per-group markers throughout the work doc. # DONE only next to the m2o→m2m promotion lines (event.question.event_id / event_type_id and their reverse sides). All other lines under # NOTHING TO DO.
| _renamed_columns = { | ||
| "event_question": [ | ||
| ("event_id", None), | ||
| ("event_type_id", None), | ||
| ], | ||
| } | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| openupgrade.rename_columns(env.cr, _renamed_columns) |
There was a problem hiding this comment.
This should not be needed since OpenUpgrade will keep the old columns (since new fields do not have the same name)
There was a problem hiding this comment.
You're right — dropped the column rename in 22c419b. Since new field names differ (event_ids vs event_id, event_type_ids vs event_type_id), OpenUpgrade preserves the old columns automatically. Post-migration now uses openupgrade.m2o_to_x2m() ×2 — one per promotion.
0034427 to
22c419b
Compare
|
@remi-filament — addressed all three threads in 22c419b:
Fork CI green on both seeds. Body refreshed to match v2 shape. Ready for re-review. |
22c419b to
42b539a
Compare
19.0 reshapes
event.question:event_id(m2o) →event_ids(m2m),event_type_id(m2o) →event_type_ids(m2m). Reverse sides onevent.eventandevent.typealso flip to m2m, sharing new join tablesevent_event_event_question_relandevent_question_event_type_rel. Since new field names differ from old, OpenUpgrade preserves the old columns automatically — no pre-migration rename needed.(noupdate)event_stage_cancelledrecord removed in 19.0.openupgrade.m2o_to_x2m()×2 (one per renamed field). Helper reads the preserved old m2o column and populates the new m2m relation table.Two pure-addition models (
event.slot,event.mail.slot) are created by ORM at init. Selection-key shrink onevent.event.badge_formatand DELevent.stagelegend_* fields left todatabase_cleanupper maintainer policy.Sibling: #5636 (6 simple
event_*submodules).