Fix the issue of accessing the SQL for Views and Materialized Views. Regression of pluralisation of folder names. Fixes #4308

This commit is contained in:
Akshay Joshi
2019-05-31 11:02:37 +05:30
parent 2185ea302d
commit 26c7d76d4f
5 changed files with 9 additions and 8 deletions

View File

@@ -1540,7 +1540,7 @@ class FunctionView(PGChildNodeView, DataTypeReader):
# Get schema name
status, schema_name = self.conn.execute_scalar(
render_template(
'schema/pg/#{0}#/sql/get_name.sql'.format(
'schemas/pg/#{0}#/sql/get_name.sql'.format(
self.manager.version),
scid=scid
)

View File

@@ -844,7 +844,7 @@ class SequenceView(PGChildNodeView):
# Get schema name
status, schema_name = self.conn.execute_scalar(
render_template(
'schema/pg/#{0}#/sql/get_name.sql'.format(
'schemas/pg/#{0}#/sql/get_name.sql'.format(
self.manager.version
),
scid=scid

View File

@@ -83,7 +83,7 @@ class IndexesModule(CollectionNodeModule):
if 'vid' not in kwargs:
return True
template_path = 'index/sql/#{0}#'.format(manager.version)
template_path = 'indexes/sql/#{0}#'.format(manager.version)
SQL = render_template(
"/".join([template_path, 'backend_support.sql']),
vid=kwargs['vid']

View File

@@ -771,7 +771,7 @@ class ViewNode(PGChildNodeView, VacuumSettings):
Updated properties data with column details
"""
self.index_temp_path = 'index'
self.index_temp_path = 'indexes'
SQL = render_template("/".join([self.index_temp_path,
'sql/#{0}#/column_details.sql'.format(
self.manager.version)]), idx=idx)
@@ -825,7 +825,7 @@ class ViewNode(PGChildNodeView, VacuumSettings):
Updated properties data with column
"""
self.trigger_temp_path = 'schema/trigger'
self.trigger_temp_path = 'schemas/triggers'
SQL = render_template("/".join([self.trigger_temp_path,
'get_columns.sql']),
tid=tid, clist=clist)
@@ -887,7 +887,7 @@ class ViewNode(PGChildNodeView, VacuumSettings):
import trigger_definition
# Define template path
self.trigger_temp_path = 'trigger'
self.trigger_temp_path = 'triggers'
SQL_data = ''
SQL = render_template("/".join(
@@ -970,7 +970,7 @@ class ViewNode(PGChildNodeView, VacuumSettings):
into sql tab
"""
self.index_temp_path = 'index'
self.index_temp_path = 'indexes'
SQL_data = ''
SQL = render_template("/".join(
[self.index_temp_path,