Skip to content

Model creates two primary keys with same column using Model.sync() function #484

Description

@figalex

I'm trying to generate my MySQL database tables from my node-orm models. Here's what I got:

var db = require('orm').db;

var User = db.define('user', {
    name: String,
    email: String,
    token: String
});

db.drop(function(){
    User.sync(function(){
    });
}); 

I let the User.sync() generates the User table in my database, I had successfully done this before but now my tables have two primary keys with the same column as you can see on the image:
screen shot 2014-04-01 at 8 34 52 pm

I've been getting "ER_OPERAND_COLUMNS: Operand should contain 1 column(s)" error everytime I want to add and instance of User to another model instance.

Does anyone know what can be causing this?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions