fix(all): TRUE multicloud.
This commit is contained in:
parent
a7be4850b7
commit
cc22f3963d
1 changed files with 63 additions and 60 deletions
|
@ -289,27 +289,10 @@ export class GBVMService extends GBService {
|
|||
if (Fs.existsSync(filePath)) {
|
||||
connections = JSON.parse(Fs.readFileSync(filePath, 'utf8'));
|
||||
}
|
||||
const shouldSync = min.core.getParam<boolean>(min.instance, 'Synchronize Database', false);
|
||||
|
||||
tableDef.forEach(async t => {
|
||||
const tableName = t.name.trim();
|
||||
connections.forEach(async con => {
|
||||
|
||||
// Determines autorelationship.
|
||||
Object.keys(t.fields).forEach(key => {
|
||||
let obj = t.fields[key];
|
||||
obj.type = getTypeBasedOnCondition(obj.type, obj.size);
|
||||
if (obj.type.key === 'TABLE') {
|
||||
obj.type.key = 'BIGINT';
|
||||
associations.push({ from: tableName, to: obj.type.name });
|
||||
}
|
||||
});
|
||||
|
||||
// Cutom connection for TABLE.
|
||||
const connectionName = t.connection;
|
||||
let con;
|
||||
|
||||
if (connectionName && connections) {
|
||||
con = connections.filter(p => p.name === connectionName)[0];
|
||||
const connectionName = con['storageDriver']
|
||||
|
||||
const dialect = con['storageDriver'];
|
||||
const host = con['storageServer'];
|
||||
|
@ -367,7 +350,27 @@ export class GBVMService extends GBService {
|
|||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const shouldSync = min.core.getParam<boolean>(min.instance, 'Synchronize Database', false);
|
||||
|
||||
tableDef.forEach(async t => {
|
||||
const tableName = t.name.trim();
|
||||
|
||||
// Determines autorelationship.
|
||||
Object.keys(t.fields).forEach(key => {
|
||||
let obj = t.fields[key];
|
||||
obj.type = getTypeBasedOnCondition(obj.type, obj.size);
|
||||
if (obj.type.key === 'TABLE') {
|
||||
obj.type.key = 'BIGINT';
|
||||
associations.push({ from: tableName, to: obj.type.name });
|
||||
}
|
||||
});
|
||||
|
||||
// Cutom connection for TABLE.
|
||||
const connectionName = t.connection;
|
||||
let con;
|
||||
|
||||
|
||||
if (!con) {
|
||||
throw new Error(`Invalid connection specified: ${connectionName}.`);
|
||||
|
|
Loading…
Add table
Reference in a new issue