Skip to content

duplicate primary key in api explorer #1585

Description

@daddybh

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.

1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions