Replies: 4 comments 3 replies
-
Hey @toadslop, good questions! Unique constraint of single column is supported. See https://www.sea-ql.org/SeaORM/docs/generate-entity/entity-structure#additional-properties. However, unique constraint with multiple columns is not supported at the moment. |
Beta Was this translation helpful? Give feedback.
-
First of all, you CAN create unique constraints across multiple columns using SeaQuery. |
Beta Was this translation helpful? Give feedback.
-
Isn't this still an issue, that should remain open? How would you implement this with sea query right now? In the sea query docs, I can only find |
Beta Was this translation helpful? Give feedback.
-
Summary
This may either be a documentation request or a feature request.
Most databases support unique contraints across columns such that there can be no record in the table where the combination of values between two columns are identical. So far from the documentation I can't find anything about this feature.
If the feature already exists, I'd like some documentation about it.
If it doesn't exist yet, I'd like it added.
Motivation
It's a basic functionality of most databases.
If SeaORM doesn't support it, it means that someone would have to write an entire table definition in raw SQL just to use that feature.
It's incredibly inconvenient.
On the other side, if the feature already exists but isn't documented, I think many people will end up wasting many hours experimenting and/or reading through the documentation for a clue that may or may not be there.
Beta Was this translation helpful? Give feedback.
All reactions