-
Notifications
You must be signed in to change notification settings - Fork 14
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
Define unique primary keys in SQL / SQLAlchemy generator #108
Comments
Beyond primary keys, there is currently no possibility to set attributes as unique (without them being a primary key). |
UML and B-UML support the setting of attributes as "ID", yet there does not seem to be a differentiation between unique and Primary Key like in SQL. Should our DB generators just treat B-UML's "ID" as unique and always create an integer primary key? (Setting anything besides an integer as primary key does not seem to be best practice) |
I can think of three solutions for dealing with unique fields in these generators, but I'm not sure which one is most efficient for this case:
Then the code generator would have to take as input the list of OCL constraints, and process them.
|
Honestly, while I agree our solution is not ideal (as we can only indicate the pk and not other unique keys) , I think it's enough for now. This is one of those things that if there is anybody really interested they could easily contribute |
Currently, the default primary key will always be an auto-generated ID. There is no possibility to set other attributes as primary key.
The text was updated successfully, but these errors were encountered: