From ca67c2f93ddc80886618c2685432e8df05d97afe Mon Sep 17 00:00:00 2001 From: Holden Rehg Date: Mon, 27 Jun 2016 09:23:47 -0500 Subject: [PATCH] auditlog: Remove migration from audittrail functionality, this is not required for version 9 --- auditlog/README.rst | 3 --- auditlog/__init__.py | 22 -------------------- auditlog/migrations/8.0.1.0/pre-migration.py | 9 -------- 3 files changed, 34 deletions(-) delete mode 100644 auditlog/migrations/8.0.1.0/pre-migration.py diff --git a/auditlog/README.rst b/auditlog/README.rst index de0cbe5d8..cdd8079ed 100644 --- a/auditlog/README.rst +++ b/auditlog/README.rst @@ -34,9 +34,6 @@ To activate it and/or change the delay, go to the .. image:: /auditlog/static/description/autovacuum.png -During installation, a one-time script will migrate any existing data from the -`audittrail` module (rules and logs). - Known issues / Roadmap ====================== diff --git a/auditlog/__init__.py b/auditlog/__init__.py index a53cc8f01..da3e36775 100644 --- a/auditlog/__init__.py +++ b/auditlog/__init__.py @@ -3,25 +3,3 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models - - -def pre_init_hook(cr): - cr.execute("SELECT 1 FROM pg_class WHERE relname = 'audittrail_rule'") - if cr.fetchall(): - migrate_from_audittrail(cr) - - -def migrate_from_audittrail(cr): - cr.execute('ALTER TABLE audittrail_rule RENAME TO auditlog_rule') - cr.execute('ALTER TABLE audittrail_rule_id_seq ' - 'RENAME TO auditlog_rule_id_seq') - cr.execute('ALTER TABLE auditlog_rule RENAME COLUMN object_id TO model_id') - cr.execute('ALTER TABLE audittrail_log RENAME TO auditlog_log') - cr.execute('ALTER TABLE audittrail_log_id_seq ' - 'RENAME TO auditlog_log_id_seq') - cr.execute('ALTER TABLE auditlog_log RENAME COLUMN object_id TO model_id') - cr.execute('ALTER TABLE audittrail_log_line RENAME TO auditlog_log_line') - cr.execute('ALTER TABLE audittrail_log_line_id_seq ' - 'RENAME TO auditlog_log_line_id_seq') - cr.execute("UPDATE ir_model_data SET model='auditlog.rule' " - "WHERE model='audittrail.rule'") diff --git a/auditlog/migrations/8.0.1.0/pre-migration.py b/auditlog/migrations/8.0.1.0/pre-migration.py deleted file mode 100644 index 3255a9270..000000000 --- a/auditlog/migrations/8.0.1.0/pre-migration.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2015 Therp BV -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.addons.auditlog import migrate_from_audittrail - - -def migrate(cr): - """if we migrate from an older version, it's a migration from audittrail""" - migrate_from_audittrail(cr)