-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add foreign key in sequelize cockroachdb #10
Comments
That error is because we don't (yet) support usermanagement.belongsTo(unit, { onDelete: 'restrict', onUpdate: 'restrict' }); |
I have the same issue, using the suggested work around also fails. Unhandled rejection SequelizeDatabaseError: unimplemented at or near "null" Unhandled rejection SequelizeDatabaseError: unimplemented at or near "restrict" |
@michaelgmcd, you need to specify both |
@benesch, same result: Unhandled rejection SequelizeDatabaseError: unimplemented at or near "restrict" |
@CJTalbot87, I'm afraid you'll need to share more details. Can you give us the model definitions and associations that don't work? Here's an example of a simple posts/comments association that does work: https://github.com/cockroachdb/sequelize-cockroachdb/pull/14/files#diff-803bac73fe9250752e76eef0d292d296R61 |
Sure, please find my code and results below. I'm running sequelize@3.30.4, sequelize-cockroachdb@1.0.2 and CCL v1.0.4 @ 2017/07/27 17:54:36 (go1.8.3) of CockroachDB:
|
I have model like
I am getting error while trying to create table
Unhandled rejection SequelizeDatabaseError: unimplemented at or near "null"
CREATE TABLE IF NOT EXISTS "user_managements" ("id" SERIAL , "email_id" VARCHAR(255) NOT NULL, "password" VARCHAR(255), "first_name" VARCHAR(255) NOT NULL, "middle_name" VARCHAR(255), "last_name" VARCHAR(255) NOT NULL, "title" VARCHAR(255) NOT NULL, "company_name" VARCHAR(255), "organisation_strength" VARCHAR(255), "industry" VARCHAR(255), "phone_number" INTEGER NOT NULL, "url" VARCHAR(255), "personnel_number" INTEGER, "user_role" VARCHAR(255) NOT NULL, "salt" VARCHAR(255), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "unitId" INTEGER REFERENCES "units" ("id") ON DELETE SET NULL ON UPDATE CASCADE, PRIMARY KEY ("id"));
The text was updated successfully, but these errors were encountered: