We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Consider the following model:
UserGroup: { fields: [ {name: 'name', type: 'string', unique: true, required: true}, {name: 'description', type: 'string'} ], hasMany: [ {model: 'User', name: 'users'} ] }
This will create a table like this:
CREATE TABLE USER_GROUP_USER ( USER_GROUP_ID BIGINT NOT NULL, USER_ID BIGINT NOT NULL, CONSTRAINT FK_USER_GROUP_USER FOREIGN KEY (USER_GROUP_ID) REFERENCES USER_GROUP(ID) ON DELETE CASCADE ON UPDATE NO ACTION );
There is no unique constraint for users in the user group table.
We should add support for a new "unique" keyword option to hasMany fields like this:
... hasMany: [ {model: 'User', name: 'users', unique: true} ] ...
With the "unique" keyword we should create a unique index like this:
CREATE unique INDEX IDX_USER_GROUP_USER ON USER_GROUP_USER(USER_GROUP_ID, USER_ID);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Consider the following model:
This will create a table like this:
There is no unique constraint for users in the user group table.
We should add support for a new "unique" keyword option to hasMany fields like this:
With the "unique" keyword we should create a unique index like this:
The text was updated successfully, but these errors were encountered: