new(basic.gblib): guid data type for TABLE keyword and as replacement for Interger Id #382.
This commit is contained in:
parent
f163204c15
commit
0212ed6e21
1 changed files with 7 additions and 0 deletions
|
@ -185,6 +185,8 @@ export class GBVMService extends GBService {
|
||||||
switch (t) {
|
switch (t) {
|
||||||
case 'string':
|
case 'string':
|
||||||
return { key: 'STRING' };
|
return { key: 'STRING' };
|
||||||
|
case 'guid':
|
||||||
|
return { key: 'UUID' };
|
||||||
case 'key':
|
case 'key':
|
||||||
return { key: 'STRING' }; // Assuming key is a string data type
|
return { key: 'STRING' }; // Assuming key is a string data type
|
||||||
case 'integer':
|
case 'integer':
|
||||||
|
@ -203,6 +205,11 @@ export class GBVMService extends GBService {
|
||||||
Object.keys(t.fields).forEach(key => {
|
Object.keys(t.fields).forEach(key => {
|
||||||
let obj = t.fields[key];
|
let obj = t.fields[key];
|
||||||
obj.type = getTypeBasedOnCondition(obj.type);
|
obj.type = getTypeBasedOnCondition(obj.type);
|
||||||
|
if (obj.name.toLowerCase() === 'id')
|
||||||
|
{
|
||||||
|
obj['primaryKey'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
minBoot.core.sequelize.define(t.name, t.fields);
|
minBoot.core.sequelize.define(t.name, t.fields);
|
||||||
|
|
Loading…
Add table
Reference in a new issue