mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added cascade option while creating an extension. #3942
This commit is contained in:
@@ -20,6 +20,7 @@ export default class ExtensionsSchema extends BaseUISchema {
|
||||
schema: '',
|
||||
relocatable: false,
|
||||
is_sys_obj: false,
|
||||
cascade: false,
|
||||
comment: null,
|
||||
});
|
||||
fieldOptions = {
|
||||
@@ -87,6 +88,10 @@ export default class ExtensionsSchema extends BaseUISchema {
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'cascade', label: gettext('Cascade?'),
|
||||
type: 'switch', mode: ['create'],
|
||||
},
|
||||
{
|
||||
id: 'oid', label: gettext('OID'), type: 'text',
|
||||
mode: ['properties'],
|
||||
|
||||
@@ -7,13 +7,17 @@
|
||||
|
||||
{% endif %}
|
||||
{% if data.name %}
|
||||
CREATE EXTENSION{% if add_not_exists_clause %} IF NOT EXISTS{% endif %} {{ 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 == '' and not data.cascade %};{% endif %}
|
||||
{% if data.schema %}
|
||||
|
||||
SCHEMA {{ conn|qtIdent(data.schema) }}{% if data.version == '' %};{% endif %}
|
||||
SCHEMA {{ conn|qtIdent(data.schema) }}{% if data.version == '' and not data.cascade %};{% endif %}
|
||||
{% endif %}
|
||||
{% if data.version %}
|
||||
|
||||
VERSION {{ conn|qtIdent(data.version) }};
|
||||
VERSION {{ conn|qtIdent(data.version) }}{% if not data.cascade %};{% endif %}
|
||||
{% endif %}
|
||||
{% if data.cascade %}
|
||||
|
||||
CASCADE;
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
CREATE EXTENSION sslinfo
|
||||
SCHEMA test_extension_schema
|
||||
VERSION "1.2";
|
||||
VERSION "1.2"
|
||||
CASCADE;
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
"data": {
|
||||
"name": "sslinfo",
|
||||
"schema": "test_extension_schema",
|
||||
"version": "1.2"
|
||||
"version": "1.2",
|
||||
"cascade": true
|
||||
},
|
||||
"expected_sql_file": "create_extension_with_all_options.sql",
|
||||
"expected_msql_file": "msql_create_extension_with_all_options.sql",
|
||||
|
||||
@@ -19,7 +19,8 @@ def get_extension_data(schema_name):
|
||||
data = {
|
||||
"name": "cube",
|
||||
"relocatable": "true",
|
||||
"schema": schema_name
|
||||
"schema": schema_name,
|
||||
"cascade": "true"
|
||||
}
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user