Support Table CHECK
Constraints
#135
-
Currently, there's no way to specify table |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
You can specify unique, primary key and reference constraints with |
Beta Was this translation helpful? Give feedback.
-
However, yesterday I discovered the generated unique constraint SQL statement for Postgres is incorrect. There will be an excess "KEY" keyword in the statement. #85 Table::create()
.table(Alias::new("film"))
.col(ColumnDef::new(Alias::new("title")).char_len(255).not_null())
.col(ColumnDef::new(Alias::new("description")).text())
.primary_key(Index::create().primary().col(Alias::new("film_id")))
.index(Index::create().unique().col(Alias::new("title")))
.to_owned() |
Beta Was this translation helpful? Give feedback.
-
You can checkout this example, https://github.com/SeaQL/sea-schema/blob/e284b5b72c098f3afab5600f848245fa28127927/tests/live/postgres/src/main.rs#L75-L162. |
Beta Was this translation helpful? Give feedback.
-
Oops, I meant to specify table |
Beta Was this translation helpful? Give feedback.
-
Hey @forrest-akin, sorry for the delay. I've just open a tracking issue for this feature request :D |
Beta Was this translation helpful? Give feedback.
-
Hi is this feature not released? I see the issue linked above and the PRs are done but don't have it on the latest crate. |
Beta Was this translation helpful? Give feedback.
Hey @forrest-akin, sorry for the delay. I've just open a tracking issue for this feature request :D