mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added flag to check before adding 'IF NOT EXISTS' and 'OR REPLACE' clause to the SQL. While creating any object the respective clause should not be added.
This commit is contained in:
committed by
Akshay Joshi
parent
05ce3445b5
commit
f192be3667
@@ -501,7 +501,8 @@ class ExtensionView(PGChildNodeView, SchemaDiffObjectCompare):
|
||||
),
|
||||
data=result,
|
||||
conn=self.conn,
|
||||
display_comments=True
|
||||
display_comments=True,
|
||||
add_not_exists_clause=True
|
||||
)
|
||||
|
||||
if not json_resp:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
{% endif %}
|
||||
{% if data.name %}
|
||||
CREATE EXTENSION IF NOT EXISTS {{ conn|qtIdent(data.name) }}{% if data.schema == '' and data.version == '' %};{% endif %}
|
||||
CREATE EXTENSION{% if add_not_exists_clause %} IF NOT EXISTS{% endif %} {{ conn|qtIdent(data.name) }}{% if data.schema == '' and data.version == '' %};{% endif %}
|
||||
{% if data.schema %}
|
||||
|
||||
SCHEMA {{ conn|qtIdent(data.schema) }}{% if data.version == '' %};{% endif %}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
CREATE EXTENSION IF NOT EXISTS sslinfo
|
||||
CREATE EXTENSION sslinfo
|
||||
SCHEMA test_extension_schema
|
||||
VERSION "1.0";
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
CREATE EXTENSION IF NOT EXISTS citext
|
||||
CREATE EXTENSION citext
|
||||
VERSION "1.0";
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
CREATE EXTENSION IF NOT EXISTS sslinfo
|
||||
CREATE EXTENSION sslinfo
|
||||
SCHEMA test_extension_schema
|
||||
VERSION "1.0";
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
CREATE EXTENSION IF NOT EXISTS sslinfo
|
||||
CREATE EXTENSION sslinfo
|
||||
SCHEMA test_extension_schema
|
||||
VERSION "1.2";
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
CREATE EXTENSION IF NOT EXISTS adminpack
|
||||
CREATE EXTENSION adminpack
|
||||
VERSION "1.0";
|
||||
|
||||
Reference in New Issue
Block a user