Fixed an issue where fetching the schema throws an error if the database

is not connected in Schema Diff. Fixes #5673

Maintenance Database is selected by default in Schema Diff.
This commit is contained in:
Akshay Joshi
2020-07-15 13:07:28 +05:30
parent bd9dc97b4f
commit 2469032f15
3 changed files with 21 additions and 14 deletions

View File

@@ -590,8 +590,10 @@ export default class SchemaDiffUI {
if (!_.isUndefined(m.get('source_sid')) && !_.isNull(m.get('source_sid'))
&& m.get('source_sid') !== '') {
setTimeout(function() {
if (self_local.options.length > 0) {
m.set('source_did', self_local.options[0].value);
for (var i = 0; i < self_local.options.length; i++) {
if (self_local.options[i].is_maintenance_db) {
m.set('source_did', self_local.options[i].value);
}
}
}, 10);
return false;
@@ -679,8 +681,10 @@ export default class SchemaDiffUI {
if (!_.isUndefined(m.get('target_sid')) && !_.isNull(m.get('target_sid'))
&& m.get('target_sid') !== '') {
setTimeout(function() {
if (self.options.length > 0) {
m.set('target_did', self.options[0].value);
for (var i = 0; i < self.options.length; i++) {
if (self.options[i].is_maintenance_db) {
m.set('target_did', self.options[i].value);
}
}
}, 10);
return false;