Return-Path: Delivered-To: apmail-db-ddlutils-user-archive@www.apache.org Received: (qmail 22214 invoked from network); 11 Jun 2007 18:47:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2007 18:47:25 -0000 Received: (qmail 77374 invoked by uid 500); 11 Jun 2007 18:47:28 -0000 Delivered-To: apmail-db-ddlutils-user-archive@db.apache.org Received: (qmail 77352 invoked by uid 500); 11 Jun 2007 18:47:28 -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 77321 invoked by uid 99); 11 Jun 2007 18:47:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2007 11:47:28 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [216.169.169.18] (HELO mail.DocFinity.com) (216.169.169.18) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2007 11:47:22 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.0.6619.12 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7AC58.DCD90958" Subject: Alter tables/database question Date: Mon, 11 Jun 2007 14:46:46 -0400 Message-ID: <411004C89F48004A9B41C341A515E7BA02793428@mail.oit.docfinity.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Alter tables/database question thread-index: AcesWN0mF5UzA5kgT6281pxsATdlow== From: "Brian Devaney" To: X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C7AC58.DCD90958 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have a few questions about some of the features in the ddlutils project and I would appreciate some advice. I am writing an application to take our model of a database and allow out clients to upgrade their databases to make sure that we have all the tables, columns etc. that we need for our software to run. This is a second attempt at this application. The earlier attempt was prior to the existence of ddlutils and never really went anywhere. I have the app creating databases with no problems, but altering an existing database has a couple of difficulties.=20 =20 Everything I see seems to be take the database model and alter the database ddlutils is connected to, to match it. So if the model has: =20 Table column1 varchar(10), column2 integer =20 And the database has: =20 Table column1 varchar(10)=20 =20 It will generate: Alter table add column column2 integer =20 Which is fine, except for the case where the database column has: =20 Table column1 varchar(10) , usercolumn varchar(20) =20 The alter script will generate: Alter table drop column usercolumn Alter table add column2 integer =20 If the user has added columns, tables, indicies or anything that does not exist in the model database, ddlutils will generate a script to delete those items. Is there any setting that will indicate to ddlutils that additional items found in the database are to be kept? =20 =20 There is also the case where the database has: Table column1 varchar(20) columns2 integer =20 Then the alter script will be: Alter table modify column1 varchar(10) =20 With some potentially disasterous results if someone modified the column width to fit data that they had. The alter cannot be allowed to run or that data could be lost. =20 What I am looking for is some way of making the model a minimum requirement rather than the exact plan. If there are extra tables that do not appear in the model, they should be left alone. Larger columns than the model are not truncated, but smaller columns are lengthened to match. Missing indicies are added, but any others are not deleted. =20 Brian Devaney DocFinity Solution Developer DocFinity(r) by Optical Image Technology, Inc. 100 Oakwood Avenue Suite 700 State College, PA 16803 ph: 814.238.0038 fax: 814.238.0011 mailto:bdevaney@docfinity.com www.docfinity.com =20 DISCLAIMER: This email may contain proprietary information, some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this email, please notify the author by replying to this email. If you are not the intended recipient, you may not use, disclose, distribute, copy, print, or rely on this email. =20 ------_=_NextPart_001_01C7AC58.DCD90958--