diff --git a/asterisk_click2dial/migrations/10.0.1.0.0/openupgrade_analysis.txt b/asterisk_click2dial/migrations/10.0.1.0.0/openupgrade_analysis.txt new file mode 100644 index 0000000..6a346ec --- /dev/null +++ b/asterisk_click2dial/migrations/10.0.1.0.0/openupgrade_analysis.txt @@ -0,0 +1,3 @@ +---Fields in module 'asterisk_click2dial'--- +asterisk_click2dial / res.users / asterisk_chan_type (selection): selection_keys is now '['DAHDI', 'H323', 'IAX2', 'MGCP', 'SCCP', 'SIP', 'Skinny', 'Zap', 'mISDN']' ('['DAHDI', 'H323', 'IAX2', 'MGCP', 'PJSIP', 'SCCP', 'SIP', 'Skinny', 'Zap', 'mISDN']') +---XML records in module 'asterisk_click2dial'--- diff --git a/asterisk_click2dial/migrations/10.0.1.0.0/openupgrade_analysis_work.txt b/asterisk_click2dial/migrations/10.0.1.0.0/openupgrade_analysis_work.txt new file mode 100644 index 0000000..a83413f --- /dev/null +++ b/asterisk_click2dial/migrations/10.0.1.0.0/openupgrade_analysis_work.txt @@ -0,0 +1,4 @@ +---Fields in module 'asterisk_click2dial'--- +asterisk_click2dial / res.users / asterisk_chan_type (selection): selection_keys is now '['DAHDI', 'H323', 'IAX2', 'MGCP', 'SCCP', 'SIP', 'Skinny', 'Zap', 'mISDN']' ('['DAHDI', 'H323', 'IAX2', 'MGCP', 'PJSIP', 'SCCP', 'SIP', 'Skinny', 'Zap', 'mISDN']') +# Done: post-migration. Mapped 'PJSIP' value to 'SIP' value +---XML records in module 'asterisk_click2dial'--- diff --git a/asterisk_click2dial/migrations/10.0.1.0.0/post-migration.py b/asterisk_click2dial/migrations/10.0.1.0.0/post-migration.py new file mode 100644 index 0000000..2e93103 --- /dev/null +++ b/asterisk_click2dial/migrations/10.0.1.0.0/post-migration.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent - Miquel Raich +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +def map_asterisk_type_pjsip_sip(cr): + openupgrade.map_values( + cr, + openupgrade.get_legacy_name('asterisk_chan_type'), + 'asterisk_chan_type', + [('PJSIP', 'SIP')], + table='res_users', write='sql') + + +@openupgrade.migrate() +def migrate(env, version): + map_asterisk_type_pjsip_sip(env.cr) diff --git a/asterisk_click2dial/migrations/10.0.1.0.0/pre-migration.py b/asterisk_click2dial/migrations/10.0.1.0.0/pre-migration.py new file mode 100644 index 0000000..89c76a4 --- /dev/null +++ b/asterisk_click2dial/migrations/10.0.1.0.0/pre-migration.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + +column_copies = { + 'res_users': [ + ('asterisk_chan_type', None, None), + ], +} + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.copy_columns(env.cr, column_copies)