Merge pull request #1542 from nitro404/hotfix/datasource-name-mismatch-warning
Add warning for datasources with mismatched names
This commit is contained in:
commit
309b422425
|
@ -375,6 +375,14 @@ DataSource.prototype.setup = function(name, settings) {
|
||||||
name = name || (connector && connector.name);
|
name = name || (connector && connector.name);
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
||||||
|
if (typeof settings === 'object' && typeof settings.name === 'string' && name !== settings.name) {
|
||||||
|
console.warn(
|
||||||
|
'A datasource has a name of %j while a name of %j is specified in ' +
|
||||||
|
'its settings. Please adjust your configuration so these names match. ' +
|
||||||
|
'%j will be assigned as the actual datasource name.',
|
||||||
|
name, settings.name, name);
|
||||||
|
}
|
||||||
|
|
||||||
if (name && !connector) {
|
if (name && !connector) {
|
||||||
if (typeof name === 'object') {
|
if (typeof name === 'object') {
|
||||||
// The first argument might be the connector itself
|
// The first argument might be the connector itself
|
||||||
|
|
Loading…
Reference in New Issue