-
-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e2a1f7
commit 946b12e
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
addons/website_event_track/migrations/13.0.1.0/openupgrade_analysis_work.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
---Models in module 'website_event_track'--- | ||
---Fields in module 'website_event_track'--- | ||
website_event_track / event.sponsor / image_128 (binary) : NEW attachment: True, isrelated: related, stored | ||
website_event_track / event.sponsor / image_medium (binary) : DEL attachment: True | ||
# DONE: pre-migration: renamed | ||
|
||
website_event_track / event.track / date_end (datetime) : NEW isfunction: function, stored | ||
# NOTHING TO DO | ||
|
||
website_event_track / event.track.tag / name (char) : now required | ||
# DONE: post-migration: assure is filled | ||
|
||
---XML records in module 'website_event_track'--- |
25 changes: 25 additions & 0 deletions
25
addons/website_event_track/migrations/13.0.1.0/post-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2020 ForgeFlow <http://www.forgeflow.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from openupgradelib import openupgrade | ||
|
||
|
||
def fill_event_track_tag_name(env): | ||
openupgrade.logged_query( | ||
env.cr, """ | ||
UPDATE event_track_tag | ||
SET name = 'default_name_' || id | ||
WHERE name IS NULL""", | ||
) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
fill_event_track_tag_name(env) | ||
openupgrade.load_data( | ||
env.cr, "website_event_track", | ||
"migrations/13.0.1.0/noupdate_changes.xml") | ||
openupgrade.delete_record_translations( | ||
env.cr, 'website_event_track', [ | ||
'mail_template_data_track_confirmation', | ||
], | ||
) |
18 changes: 18 additions & 0 deletions
18
addons/website_event_track/migrations/13.0.1.0/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2020 ForgeFlow <http://www.forgeflow.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from openupgradelib import openupgrade | ||
|
||
|
||
def rename_image_attachments(env): | ||
for old, new in [("image_medium", "image_128")]: | ||
openupgrade.logged_query( | ||
env.cr, """ | ||
UPDATE ir_attachment SET res_field = %s | ||
WHERE res_field = %s AND res_model = 'event.sponsor'""", | ||
(new, old), | ||
) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
rename_image_attachments(env) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters