Browse Source

[10.0][FIX] asterisk_click2dial: Migration scripts

pull/134/head
mreficent 8 years ago
parent
commit
6f41354298
  1. 3
      asterisk_click2dial/migrations/10.0.1.0.0/openupgrade_analysis.txt
  2. 4
      asterisk_click2dial/migrations/10.0.1.0.0/openupgrade_analysis_work.txt
  3. 18
      asterisk_click2dial/migrations/10.0.1.0.0/post-migration.py
  4. 15
      asterisk_click2dial/migrations/10.0.1.0.0/pre-migration.py

3
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'---

4
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'---

18
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)

15
asterisk_click2dial/migrations/10.0.1.0.0/pre-migration.py

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent <http://www.eficent.com>
# 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)
Loading…
Cancel
Save