Ensure that Partitioned tables should be visible correctly when creating multiple partition levels. Fixes #7085

This commit is contained in:
Nikhil Mohite 2022-01-12 16:29:13 +05:30 committed by Akshay Joshi
parent e38c38cd58
commit d2457f2a1d
3 changed files with 14 additions and 0 deletions

View File

@ -17,4 +17,5 @@ Housekeeping
Bug fixes Bug fixes
********* *********
| `Issue #7085 <https://redmine.postgresql.org/issues/7085>`_ - Ensure that Partitioned tables should be visible correctly when creating multiple partition levels.
| `Issue #7100 <https://redmine.postgresql.org/issues/7100>`_ - Fixed an issue where the Browser tree gets disappears when scrolling sequences. | `Issue #7100 <https://redmine.postgresql.org/issues/7100>`_ - Fixed an issue where the Browser tree gets disappears when scrolling sequences.

View File

@ -350,6 +350,9 @@ class PartitionsView(BaseTableView, DataTypeReader, SchemaDiffObjectCompare):
status, res = self._fetch_properties(did, scid, tid, ptid) status, res = self._fetch_properties(did, scid, tid, ptid)
if not status:
return res
if len(res['rows']) == 0: if len(res['rows']) == 0:
return gone(self.not_found_error_msg()) return gone(self.not_found_error_msg())
@ -461,6 +464,9 @@ class PartitionsView(BaseTableView, DataTypeReader, SchemaDiffObjectCompare):
status, res = self._fetch_properties(did, scid, tid, ptid) status, res = self._fetch_properties(did, scid, tid, ptid)
if not status:
return res
if len(res['rows']) == 0: if len(res['rows']) == 0:
return gone(self.not_found_error_msg()) return gone(self.not_found_error_msg())
@ -637,6 +643,9 @@ class PartitionsView(BaseTableView, DataTypeReader, SchemaDiffObjectCompare):
if ptid is not None: if ptid is not None:
status, res = self._fetch_properties(did, scid, tid, ptid) status, res = self._fetch_properties(did, scid, tid, ptid)
if not status:
return res
SQL, name = self.get_sql(did, scid, ptid, data, res) SQL, name = self.get_sql(did, scid, ptid, data, res)
SQL = re.sub('\n{2,}', '\n\n', SQL) SQL = re.sub('\n{2,}', '\n\n', SQL)
SQL = SQL.strip('\n') SQL = SQL.strip('\n')
@ -678,6 +687,9 @@ class PartitionsView(BaseTableView, DataTypeReader, SchemaDiffObjectCompare):
try: try:
status, res = self._fetch_properties(did, scid, tid, ptid) status, res = self._fetch_properties(did, scid, tid, ptid)
if not status:
return res
return super(PartitionsView, self).update( return super(PartitionsView, self).update(
gid, sid, did, scid, ptid, data=data, res=res, parent_id=tid) gid, sid, did, scid, ptid, data=data, res=res, parent_id=tid)
except Exception as e: except Exception as e:

View File

@ -171,6 +171,7 @@ export class ManageTreeNodes {
} }
_path = _parent; _path = _parent;
} }
_partitions = _partitions.reverse();
// Replace the table with the last partition as in reality partition node is not child of the table // Replace the table with the last partition as in reality partition node is not child of the table
if(_partitions.length > 0) _parent_path[0] = _partitions[_partitions.length-1]; if(_partitions.length > 0) _parent_path[0] = _partitions[_partitions.length-1];