summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorced <>2007-10-10 13:32:26 +0000
committerced <>2007-10-10 13:32:26 +0000
commitcf35e2b1366791bba300da7616b17b5d16dc911a (patch)
tree96ad4b2ad99810e8227ea7591a86cdec60d115a4 /doc
parenta6b8fe83b7c5a31f52457f1d538b39f67b8007cc (diff)
Add primary key on table inherits ir_actions
bzr revid: ced-fafa824a7b9df0dac499814aaf2b77a606700de5
Diffstat (limited to 'doc')
-rw-r--r--doc/migrate/4.0.0-4.2.0/pre.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/migrate/4.0.0-4.2.0/pre.py b/doc/migrate/4.0.0-4.2.0/pre.py
index 22465ccce2d..49ed2fc835e 100644
--- a/doc/migrate/4.0.0-4.2.0/pre.py
+++ b/doc/migrate/4.0.0-4.2.0/pre.py
@@ -227,5 +227,25 @@ cr.execute('UPDATE res_country SET code = UPPER(code)')
cr.execute('UPDATE res_country_state SET code = UPPER(code)')
cr.commit()
+# --------------------------------------------- #
+# Add primary key on tables inherits ir_actions #
+# --------------------------------------------- #
+
+cr.execute('SELECT indexname FROm pg_indexes WHERE indexname = \'ir_act_report_xml_pkey\' and tablename = \'ir_act_report_xml\'')
+if not cr.fetchall():
+ cr.execute('ALTER TABLE ir_act_report_xml ADD PRIMARY KEY (id)')
+cr.execute('SELECT indexname FROm pg_indexes WHERE indexname = \'ir_act_report_custom_pkey\' and tablename = \'ir_act_report_custom\'')
+if not cr.fetchall():
+ cr.execute('ALTER TABLE ir_act_report_custom ADD PRIMARY KEY (id)')
+cr.execute('SELECT indexname FROm pg_indexes WHERE indexname = \'ir_act_group_pkey\' and tablename = \'ir_act_group\'')
+if not cr.fetchall():
+ cr.execute('ALTER TABLE ir_act_group ADD PRIMARY KEY (id)')
+cr.execute('SELECT indexname FROm pg_indexes WHERE indexname = \'ir_act_execute_pkey\' and tablename = \'ir_act_execute\'')
+if not cr.fetchall():
+ cr.execute('ALTER TABLE ir_act_execute ADD PRIMARY KEY (id)')
+cr.execute('SELECT indexname FROm pg_indexes WHERE indexname = \'ir_act_wizard_pkey\' and tablename = \'ir_act_wizard\'')
+if not cr.fetchall():
+ cr.execute('ALTER TABLE ir_act_wizard ADD PRIMARY KEY (id)')
+cr.commit()
cr.close