<commit_before># -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


def migrate(cr, version):
    cr.execute('ALTER TABLE carepoint_medical_prescription_order_line '
               'RENAME TO carepoint_rx_ord_ln')

    cr.execute('ALTER TABLE carepoint_carepoint_organization '
               'RENAME TO carepoint_org_bind')
<commit_msg>[FIX] connector_carepoint: Fix prescription migration * Add try/catch & rollback to db alterations in case server re-upgrades<commit_after># -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import logging

_logger = logging.getLogger(__name__)


def migrate(cr, version):
    try:
        cr.execute('ALTER TABLE carepoint_medical_prescription_order_line '
                   'RENAME TO carepoint_rx_ord_ln')
    except Exception:
        cr.rollback()
        _logger.exception('Cannot perform migration')

    try:
        cr.execute('ALTER TABLE carepoint_carepoint_organization '
                   'RENAME TO carepoint_org_bind')
    except Exception:
        cr.rollback()
        _logger.exception('Cannot perform migration')

{'fraction_non_alphanumeric': 0.1004149377593361, 'fraction_numerical': 0.011618257261410789, 'mean_word_length': 3.1443298969072164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5008377', 'n_tokens_mistral': 373, 'n_tokens_neox': 349, 'n_words': 86}