diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/templates/collation/js/collation.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/templates/collation/js/collation.js index eb12f40..eb331a4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/templates/collation/js/collation.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/templates/collation/js/collation.js @@ -108,7 +108,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { // Set schema default value to its parent Schema if(this.model.isNew()){ - this.model.set({'schema': this.model.node_info.schema.label}); + this.model.set({'schema': this.model.node_info.schema.label}); } return this; } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/js/domains.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/js/domains.js index 3a4542f..91df7bd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/js/domains.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/js/domains.js @@ -115,7 +115,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { collection_type: 'coll-domain', hasSQL: true, hasDepends: true, - parent_type: ['schema'], + parent_type: ['schema', 'catalog'], Init: function() { // Avoid mulitple registration of menus if (this.initialized) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configuration/js/fts_configuration.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configuration/js/fts_configuration.js index 42ed550..8383872 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configuration/js/fts_configuration.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configuration/js/fts_configuration.js @@ -461,14 +461,12 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { }, initialize: function(attrs, args) { var isNew = (_.size(attrs) === 0); + pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments); if (isNew) { var userInfo = pgBrowser.serverInfo[args.node_info.server._id].user; this.set({'owner': userInfo.name}, {silent: true}); - } - pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments); - if (_.isUndefined(this.get('schema'))) { - this.set('schema', this.node_info.schema._id); + this.set('schema', args.node_info.schema._id); } }, // Defining schema for FTS Configuration @@ -576,4 +574,4 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { } return pgBrowser.Nodes['coll-fts_configuration']; -}); \ No newline at end of file +}); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/js/fts_dictionary.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/js/fts_dictionary.js index 57b0520..2bfc98b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/js/fts_dictionary.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionary/js/fts_dictionary.js @@ -102,14 +102,12 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { }, initialize: function(attrs, args) { var isNew = (_.size(attrs) === 0); + pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments); if (isNew) { var userInfo = pgBrowser.serverInfo[args.node_info.server._id].user; this.set({'owner': userInfo.name}, {silent: true}); - } - pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments); - if (_.isUndefined(this.get('schema'))) { - this.set('schema', this.node_info.schema._id); + this.set('schema', args.node_info.schema._id); } }, // Defining schema for fts dictionary diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/templates/fts_parser/js/fts_parser.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/templates/fts_parser/js/fts_parser.js index fa541e3..832800a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/templates/fts_parser/js/fts_parser.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/templates/fts_parser/js/fts_parser.js @@ -68,13 +68,14 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { prslextype: undefined, // Lextype function for fts parser prsheadline: undefined // Headline function for fts parse }, - initialize: function() { - pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, - arguments - ); - if (_.isUndefined(this.get('schema'))) { - this.set('schema', this.node_info.schema._id); - } + initialize: function(attrs, args) { + var isNew = (_.size(attrs) === 0); + pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, + arguments + ); + if (isNew) { + this.set('schema', args.node_info.schema._id); + } }, // Defining schema for fts parser schema: [{ diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/templates/fts_template/js/fts_templates.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/templates/fts_template/js/fts_templates.js index 4b0e449..9d2d0d4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/templates/fts_template/js/fts_templates.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/templates/fts_template/js/fts_templates.js @@ -63,11 +63,12 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { tmplinit: undefined, // Init function for fts template tmpllexize: undefined // Lexize function for fts template }, - initialize: function() { - pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments); - if (_.isUndefined(this.get('schema'))) { - this.set('schema', this.node_info.schema._id); - } + initialize: function(attrs, args) { + var isNew = (_.size(attrs) === 0); + pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments); + if (isNew) { + this.set('schema', args.node_info.schema._id); + } }, // Defining schema for fts template schema: [{ diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/js/procedures.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/js/procedures.js index d2a1bea..8fe0a5a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/js/procedures.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/js/procedures.js @@ -30,7 +30,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify, Function) { hasSQL: true, hasDepends: true, hasScriptTypes: ['create', 'exec'], - parent_type: ['schema'], + parent_type: ['schema', 'catalog'], Init: function() { /* Avoid mulitple registration of menus */ if (this.proc_initialized)