-
Notifications
You must be signed in to change notification settings - Fork 60
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
add comment and check to @Table and @Column #381
Comments
A rough draft of this new feature is proposed here: #382 |
How about a |
Ummmm ... how widely supported is that? I don't usually give names to check constraints. (And we don't have support for it in Hibernate.)
WDYM? SQL has a column-level create table books (
id int4 not null,
isbn varchar(13),
published date not null,
title varchar(100) not null,
author_id int4 not null,
primary key (id),
check (length(title)>length(isbn))
) (Stupid example of course.) |
AFAIU every constraint can be named and has an implicit name anyways. We don't support that yet in Hibernate, but maybe we should. If you have multiple constraints, it would be nice to give fixed names to be able to understand in a
Ok, don't mind me. I always added check constraints explicitly with a name or to columns directly, so I wasn't aware that one can specify a check constraint this way. |
The problem with that is it's just soooo much uglier to use, for kinda limited benefit, it seems to me. |
The only use case for this member is when creating check constraints that involve multiple columns. Is it really so common to do that? And even if it is very common, I don't think this is a big deal, but maybe others have different opinions. |
OK, yeah, sure, fine, so the syntax |
I think the main issue is that a toplevel A much less important motivation is for check constraints on join columns, since |
@beikov OK, I've updated the PR to introduce a |
see #381 Co-authored-by: Lukas Jungmann <[email protected]>
I propose adding the new members
comment
andcheck
to the@Table
and@Column
annotations, allowing the program to customize generated DDL with a check constraint and/or comment.The text was updated successfully, but these errors were encountered: