Return-Path: Delivered-To: apmail-db-ddlutils-user-archive@www.apache.org Received: (qmail 52696 invoked from network); 5 May 2008 22:48:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 May 2008 22:48:09 -0000 Received: (qmail 25335 invoked by uid 500); 5 May 2008 22:48:10 -0000 Delivered-To: apmail-db-ddlutils-user-archive@db.apache.org Received: (qmail 25320 invoked by uid 500); 5 May 2008 22:48:10 -0000 Mailing-List: contact ddlutils-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-user@db.apache.org Delivered-To: mailing list ddlutils-user@db.apache.org Received: (qmail 25308 invoked by uid 99); 5 May 2008 22:48:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 May 2008 15:48:10 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [87.248.110.147] (HELO n30.bullet.mail.ukl.yahoo.com) (87.248.110.147) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 05 May 2008 22:47:13 +0000 Received: from [217.12.4.215] by n30.bullet.mail.ukl.yahoo.com with NNFMP; 05 May 2008 22:47:34 -0000 Received: from [87.248.111.149] by t2.bullet.ukl.yahoo.com with NNFMP; 05 May 2008 22:47:34 -0000 Received: from [127.0.0.1] by omp206.mail.ukl.yahoo.com with NNFMP; 05 May 2008 22:47:34 -0000 X-Yahoo-Newman-Id: 444835.74538.bm@omp206.mail.ukl.yahoo.com Received: (qmail 48670 invoked from network); 5 May 2008 22:28:14 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.es; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=Y2u7FyvL2Nzx3vVROFt9C5oqTQiHlW4B5UyHYCMi64tgOcOBhGmpYWY1zQMG784eIQtUP2vDXFrAEJ6OmuWfIEzdvHJ7cm60s7Hf5Xd0qT9SILM7RrUTMdM7Fx1yU0tsSi/OJAjDUtM5jh/S47Krz9Y63cys4KdAcogE/RETb8w= ; Received: from unknown (HELO Father.family) (rpm_oo@84.77.172.244 with plain) by smtp105.mail.ukl.yahoo.com with SMTP; 5 May 2008 22:28:14 -0000 X-YMail-OSG: _xrJ5BkVM1mod_kX90v44pv0AV0uLweMbCVMnIgrCup8pevDuU6FpGDuJC0FLZunCYuCQTzId5vxftg2EWRSkF3ldqKw5MuLGHvu1kFL1FXZO8xostBoYH72_aPm8Rq_oQwFn4orA3YBfvux6lDRzShC X-Yahoo-Newman-Property: ymail-3 Message-ID: <481F89FD.40108@yahoo.es> Date: Tue, 06 May 2008 00:28:13 +0200 From: Ricardo Palomares User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: DdlUtils Mailing List Subject: Any workaround for unique constraints? Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, Some time ago (about a year) I asked about a problem with unique constraints, and I was told that DdlUtils didn't support it and that it was intended to work for DdlUtils 1.1. Now I've seen that it is targeted for 1.2: http://issues.apache.org/jira/browse/DDLUTILS-85 which is perfectly normal and I bear with it (especially since I've progressed with my app much less than DdlUtils in this whole year). :-) However, I'd really like to be able to use DdlUtils so when I ship the application, my users don't have to mess themselves with SQL commands in case I change the DB schema (and I will likely change over time). The typical case I'm hitting is: Table1: - ID: synthetic PK - T1CODE: "user-friendly" code, guaranteed to be unique Table2: - ID: synthetic PK - T1CODE: foreign key to Table1.T1CODE - T2CODE: "user-friendly" code, unique when concatenated to T1CODE. The reason why I don't want to base Table2 foreign key on Table1.ID is to avoid double queries just to retrieve T1CODE. The reason why I don't want to set T1CODE the PK is because there are (minimal) chances for T1CODE values to change over time. Although they should always be unique, I'd rather not depend on this being true. So, assuming I can't declare unique constraints and that sometimes I won't be able to base foreign keys dependencies on primary keys, is there any way I can still use DdlUtils while declaring those kind of foreign keys? TIA -- Command line: The most efficient method available for accidentally deleting data. (The Devil's Dictionary) * TagZilla 0.066 *