mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added Schema Diff tool to compare two schemas and generate the difference script.
Currently supported objects are Table, View, Materialized View, Function and Procedure. Backend comparison of two schemas implemented by: Akshay Joshi Fixes #3452.
This commit is contained in:
committed by
Akshay Joshi
parent
8b99a33e6e
commit
45f2e35a99
@@ -84,6 +84,8 @@ define('tools.querytool', [
|
||||
this.handler.preferences = this.preferences;
|
||||
this.connIntervalId = null;
|
||||
this.layout = opts.layout;
|
||||
this.set_server_version(opts.server_ver);
|
||||
this.trigger('pgadmin-sqleditor:view:initialised');
|
||||
},
|
||||
|
||||
// Bind all the events
|
||||
@@ -2318,6 +2320,12 @@ define('tools.querytool', [
|
||||
}
|
||||
},
|
||||
|
||||
set_value_to_editor: function(query) {
|
||||
if (this.gridView && this.gridView.query_tool_obj && !_.isUndefined(query)) {
|
||||
this.gridView.query_tool_obj.setValue(query);
|
||||
}
|
||||
},
|
||||
|
||||
init_events: function() {
|
||||
var self = this;
|
||||
// Listen to the file manager button events
|
||||
|
||||
@@ -4,5 +4,5 @@ SELECT at.attname, at.attnum, ty.typname
|
||||
FROM pg_attribute at LEFT JOIN pg_type ty ON (ty.oid = at.atttypid)
|
||||
WHERE attrelid={{obj_id}}::oid AND attnum = ANY (
|
||||
(SELECT con.conkey FROM pg_class rel LEFT OUTER JOIN pg_constraint con ON con.conrelid=rel.oid
|
||||
AND con.contype='p' WHERE rel.relkind IN ('r','s','t') AND rel.oid = {{obj_id}}::oid)::oid[])
|
||||
AND con.contype='p' WHERE rel.relkind IN ('r','s','t') AND rel.oid = ({{obj_id}})::oid)::oid[])
|
||||
{% endif %}
|
||||
|
||||
@@ -35,12 +35,13 @@ def get_columns_types(is_query_tool, columns_info, table_oid, conn, has_oids):
|
||||
column_types[col['name']] = col_type
|
||||
|
||||
if not is_query_tool:
|
||||
col_type['not_null'] = col['not_null'] = \
|
||||
rset['rows'][key]['not_null']
|
||||
if key in rset['rows']:
|
||||
col_type['not_null'] = col['not_null'] = \
|
||||
rset['rows'][key]['not_null']
|
||||
|
||||
col_type['has_default_val'] = \
|
||||
col['has_default_val'] = \
|
||||
rset['rows'][key]['has_default_val']
|
||||
col_type['has_default_val'] = \
|
||||
col['has_default_val'] = \
|
||||
rset['rows'][key]['has_default_val']
|
||||
|
||||
else:
|
||||
for row in rset['rows']:
|
||||
|
||||
Reference in New Issue
Block a user