mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix incomplete reverse engineered SQL for databases. Fixes #1420
This commit is contained in:
committed by
Dave Page
parent
9ad0bd1026
commit
f58c4df85d
@@ -860,8 +860,16 @@ class DatabaseView(PGChildNodeView):
|
|||||||
frmtd_variables = parse_variables_from_db(res1['rows'])
|
frmtd_variables = parse_variables_from_db(res1['rows'])
|
||||||
result.update(frmtd_variables)
|
result.update(frmtd_variables)
|
||||||
|
|
||||||
|
sql_header = """
|
||||||
|
-- Database: {0}
|
||||||
|
|
||||||
|
-- DROP DATABASE {0};
|
||||||
|
|
||||||
|
""".format(result['name'])
|
||||||
|
|
||||||
SQL = self.get_new_sql(gid, sid, result, did)
|
SQL = self.get_new_sql(gid, sid, result, did)
|
||||||
SQL = re.sub('\n{2,}', '\n\n', SQL)
|
SQL = re.sub('\n{2,}', '\n\n', SQL)
|
||||||
|
SQL = sql_header + SQL
|
||||||
SQL = SQL.strip('\n')
|
SQL = SQL.strip('\n')
|
||||||
return ajax_response(response=SQL)
|
return ajax_response(response=SQL)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user