Can i have two primary keys on the same table? #350
Replies: 1 comment 3 replies
-
There is always one primary key in one table. Why do you want two primary key ? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can i have two primary keys on the same table?
ex.
var tbRepcli = {
name: 'Repcli',
columns: {
rep_codigo: { primaryKey: true, dataType: "number"},
cli_codigo: { primaryKey: true, dataType: "number"},
rep_ativo: { notNull: true, dataType: "string" }
}
};
I'm trying to insert these rows:
[4, 56, "SIM"];
[4, 87, "SIM"];
and this error ocurred:
{message: "Unable to add key to index 'rep_codigo': at least …key does not satisfy the uniqueness requirements.", type: 'ConstraintError'}
Beta Was this translation helpful? Give feedback.
All reactions