summaryrefslogtreecommitdiff
path: root/odoo/tools/sql.py
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2017-03-14 14:52:44 +0100
committerRaphael Collet <rco@openerp.com>2017-03-14 14:52:44 +0100
commit4deac93788c49b7d71149fbec3a2d35bdb247729 (patch)
tree54af15b9193ebe630196e3f5cb0947e035942b59 /odoo/tools/sql.py
parent65a5ced979821afed0711e662e2fa7f6ba8a67dd (diff)
[FIX] tools/sql: column name in `fix_foreign_key`
Diffstat (limited to 'odoo/tools/sql.py')
-rw-r--r--odoo/tools/sql.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/tools/sql.py b/odoo/tools/sql.py
index 34d1a84cd98..bd947dd913c 100644
--- a/odoo/tools/sql.py
+++ b/odoo/tools/sql.py
@@ -141,7 +141,7 @@ def fix_foreign_key(cr, tablename1, columnname1, tablename2, columnname2, ondele
"""
# Do not use 'information_schema' here, as those views are awfully slow!
deltype = _CONFDELTYPES.get(ondelete.upper(), 'a')
- query = """ SELECT con.conname, c2.relname, a2.attnum, con.confdeltype as deltype
+ query = """ SELECT con.conname, c2.relname, a2.attname, con.confdeltype as deltype
FROM pg_constraint as con, pg_class as c1, pg_class as c2,
pg_attribute as a1, pg_attribute as a2
WHERE con.contype='f' AND con.conrelid=c1.oid AND con.confrelid=c2.oid