ariga / atlas

Manage your database schema as code
https://atlasgo.io
Apache License 2.0
6.01k stars 267 forks source link

cockroachdb check constraint errors #1611

Open mbyio opened 1 year ago

mbyio commented 1 year ago

I'm trying to add a check constraint to a cockroachdb table. Atlasgo always adds NO INHERIT to the end, only to this particular constraint. I'm not sure if that is actually because I'm using the cockroach dev DB or something else. Cockroach doesn't support table inheritance yet and throws an error when it sees the NO INHERIT clause.

Example:

ALTER TABLE "myschema"."mytable" ADD CONSTRAINT "check_day" CHECK (day >= 0) NO INHERIT;

I get the error

Error: modify "mytable" table: pq: at or near "no": syntax error
GV14982 commented 1 year ago

I am seeing the same error.