You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have a problem of synchronization on the name connection, in index.js (line 256):
if (connectionDescription.dialect === 'postgres') {
syncTasks.push(connections[connectionName].showAllSchemas().then(schemas => {
let modelName, modelDef, tableSchema;
for (modelName in models) {
modelDef = models[modelName];
tableSchema = modelDef.options.schema || '';
if (tableSchema !== '' && schemas.indexOf(tableSchema) < 0) { // there is no schema in db for model
connections[connectionName].createSchema(tableSchema);
schemas.push(tableSchema);
}
}
return connections[connectionName].sync({ force: forceSyncFlag, alter: alterFlag });
}));
} else {}
Since "syncTasks" can take some time, connectionName can contain a wrong value, in my case it contains the last item of the data array.
Your must replace by this :
if (connectionDescription.dialect === 'postgres') {
let cn = connectionName
syncTasks.push(connections[cn].showAllSchemas().then(schemas => {
let modelName, modelDef, tableSchema;
for (modelName in models) {
modelDef = models[modelName];
tableSchema = modelDef.options.schema || '';
if (tableSchema !== '' && schemas.indexOf(tableSchema) < 0) { // there is no schema in db for model
connections[cn].createSchema(tableSchema);
schemas.push(tableSchema);
}
}
return connections[cn].sync({ force: forceSyncFlag, alter: alterFlag });
}));
} else {
For reproduction, you must have several datastore in file : config/datastores.js
Hi @Droppix ! Thanks for pointing out. I've fixed it.
I don't see any reason to introduce new option, as if you do not need a datastore connection in you app — simply remove (or comment out) it :)
And using adapter attribute i'm trying to figure out what connections are waterline, so i skip them.
Hi,
You have a problem of synchronization on the name connection, in index.js (line 256):
Since "syncTasks" can take some time, connectionName can contain a wrong value, in my case it contains the last item of the data array.
Your must replace by this :
For reproduction, you must have several datastore in file : config/datastores.js
and in the config/models .js :
So, it would be nice to have an option that would inhibit a connection (in order for it to work, I had to add -> adapter : {})
The text was updated successfully, but these errors were encountered: