Author: nunofsantos
Date: 2008-12-10 12:18:30 -0500 (Wed, 10 Dec 2008)
New Revision: 2962
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/python/mint/schemaparser.py
mgmt/trunk/mint/sql/triggers.sql
Log:
use deprecated tg_relname instead of newer tg_table_name, to support postgresql 8.1.x on
rhel5
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-12-10 16:47:54 UTC (rev 2961)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-12-10 17:18:30 UTC (rev 2962)
@@ -529,7 +529,7 @@
lazyUpdate = True
qmfUpdateTime = TimestampCol(default=None)
- Acl = ForeignKey('Acl', cascade='null', default=None)
+ acl = ForeignKey('Acl', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
aclDenyCount = BigIntCol(default=None)
@@ -577,7 +577,7 @@
lazyUpdate = True
qmfUpdateTime = TimestampCol(default=None)
- Cluster = ForeignKey('Cluster', cascade='null', default=None)
+ cluster = ForeignKey('Cluster', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
Modified: mgmt/trunk/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/trunk/mint/python/mint/schemaparser.py 2008-12-10 16:47:54 UTC (rev 2961)
+++ mgmt/trunk/mint/python/mint/schemaparser.py 2008-12-10 17:18:30 UTC (rev 2962)
@@ -239,10 +239,10 @@
update_parent varchar;
BEGIN
-- remove "_stats" suffix from table name
- parent_table := substr(tg_table_name, 0, char_length(tg_table_name) - 5);
+ parent_table := substr(tg_relname, 0, char_length(tg_relname) - 5);
update_parent := ''UPDATE '' || parent_table ||
'' SET stats_prev_id = stats_curr_id, stats_curr_id = '' || new.id
||
- '' WHERE id = (SELECT '' || parent_table || ''_id FROM
'' || tg_table_name || '' WHERE id = '' || new.id ||
'')'';
+ '' WHERE id = (SELECT '' || parent_table || ''_id FROM
'' || tg_relname || '' WHERE id = '' || new.id ||
'')'';
EXECUTE update_parent;
RETURN new;
END
Modified: mgmt/trunk/mint/sql/triggers.sql
===================================================================
--- mgmt/trunk/mint/sql/triggers.sql 2008-12-10 16:47:54 UTC (rev 2961)
+++ mgmt/trunk/mint/sql/triggers.sql 2008-12-10 17:18:30 UTC (rev 2962)
@@ -22,10 +22,10 @@
update_parent varchar;
BEGIN
-- remove "_stats" suffix from table name
- parent_table := substr(tg_table_name, 0, char_length(tg_table_name) - 5);
+ parent_table := substr(tg_relname, 0, char_length(tg_relname) - 5);
update_parent := ''UPDATE '' || parent_table ||
'' SET stats_prev_id = stats_curr_id, stats_curr_id = '' || new.id
||
- '' WHERE id = (SELECT '' || parent_table || ''_id FROM
'' || tg_table_name || '' WHERE id = '' || new.id ||
'')'';
+ '' WHERE id = (SELECT '' || parent_table || ''_id FROM
'' || tg_relname || '' WHERE id = '' || new.id ||
'')'';
EXECUTE update_parent;
RETURN new;
END
Show replies by date