db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Palomares <rpmdisguise-j...@yahoo.es>
Subject Re: Any workaround for unique constraints?
Date Fri, 09 May 2008 17:09:13 GMT
Thomas Dudziak escribió:
> I might be misunderstanding your use case, but if you use
> Table1.T1CODE as the target of a database foreign key, the database
> requires that Table1.T1CODE is unique.


...Exactly, and when I asked about this the first time, you told me
that DdlUtils couldn't add a UNIQUE constraint (not index):


> Derby requires that the columns in the referenced table are part of
> the primary key or unique. Note that this is the unique column
> constraint, not the unique index
> (http://db.apache.org/derby/docs/10.2/ref/rrefsqlj16095.html#rrefsqlj16095).
> DdlUtils currently cannot create unique columns (a feature request for
> 1.1), so with DdlUtils the columns have to be part of the primary key.


I guess that Issue #85:

  http://issues.apache.org/jira/browse/DDLUTILS-85

deals with this, and based on it I've assumed that DdlUtils 1.0
doesn't implement this feature yet. Am I wrong?


> (...) You can still maintain a semi-foreign key relationship
> on the application level, though.


Yep, the problem has appeared because I've tried to use NetBeans 6.1
GUI wizard to create a master-detail CRUD form, and NB requires the
foreign key to be declared in the database schema.

I'm trying to maintain the database schema exclusively through
DdlUtils, so every time I run my appliction DdlUtils checks the db
schema vs. the XML definition. I could stop doing this and take care
of the schema manually, but as soon as I ship the application and I
need to provide an update without DdlUtil unvaluable help, the users
would need to type SQL command themselves, and I'd rather avoid that.

OTOH, DdlUtils 1.2 will probably arrive before I get my app ready,
so... :-)

Thank you very much.




Mime
View raw message