Hi, I wrote a script to generate model from mysql database.
The table is like:
| Column Name |
PK |
TYPE |
NN |
| ThreadID |
primary key |
int |
not null |
| TopicID |
|
int |
not null |
My script is simply use discoverSchema api and write scheme to file.
ds.discoverModelDefinitions({
all: false,
schema: 'db_uc_quan',
views: false
},
function(err, models) {
models.forEach(function(def) {
ds.discoverSchema(def.name, null, function(err, schema) {
fs.writeFileSync(path, JSON.stringify(schme, null, 2));
})
})
});
Checking the api explorer, there is a duplicate primary key in the schema. Why is this happening?
I have to manually change the threadid field to ThreadID to solve this issue.
But some tables do not have this issue.

Hi, I wrote a script to generate model from mysql database.
The table is like:
My script is simply use
discoverSchemaapi and write scheme to file.Checking the api explorer, there is a duplicate primary key in the schema. Why is this happening?
I have to manually change the
threadidfield toThreadIDto solve this issue.But some tables do not have this issue.