You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by Jun Li <al...@gmail.com> on 2007/01/30 05:20:18 UTC
Alter column issue.
Hi all,
The problem was if there were indices referencing the column, the indices
didn't get dropped and recreated afterwards just like foreign
key constrains. For primary key columns, it's the primary key constrain
needs to be take care of (drop before alter the column and recreate
afterwards).
--------------
Cheers,
Jun
Re: Alter column issue.
Posted by Jun Li <al...@gmail.com>.
It's https://issues.apache.org/jira/browse/DDLUTILS-153
Thanks.
On 1/31/07, Thomas Dudziak <to...@gmail.com> wrote:
>
> On 1/30/07, Jun Li <al...@gmail.com> wrote:
>
> > I'm not dropping the column but alter the data type of it, therefore the
> > schema is certainly valid. At least on SQL Server, if there are indices
> > reference the column which needs to be altered, the sql statements
> generated
> > by DdlUtils will fail. In this case, the indices need to be handled just
> > like fk constraints.
>
> Mhmm, the unit tests for this work on Sql Server 2000 and 2005, so
> could you please create an issue in JIRA and attach the relevant
> schema snippet as well as the error message that you receive, and info
> about the environment that you're using (SQL Server version, JDBC
> driver) ?
>
> Tom
>
--
--------------
Cheers,
Jun
Re: Alter column issue.
Posted by Thomas Dudziak <to...@gmail.com>.
On 1/30/07, Jun Li <al...@gmail.com> wrote:
> I'm not dropping the column but alter the data type of it, therefore the
> schema is certainly valid. At least on SQL Server, if there are indices
> reference the column which needs to be altered, the sql statements generated
> by DdlUtils will fail. In this case, the indices need to be handled just
> like fk constraints.
Mhmm, the unit tests for this work on Sql Server 2000 and 2005, so
could you please create an issue in JIRA and attach the relevant
schema snippet as well as the error message that you receive, and info
about the environment that you're using (SQL Server version, JDBC
driver) ?
Tom
Re: Alter column issue.
Posted by Jun Li <al...@gmail.com>.
I'm not dropping the column but alter the data type of it, therefore the
schema is certainly valid. At least on SQL Server, if there are indices
reference the column which needs to be altered, the sql statements generated
by DdlUtils will fail. In this case, the indices need to be handled just
like fk constraints.
On 1/30/07, Thomas Dudziak <to...@gmail.com> wrote:
>
> On 1/29/07, Jun Li <al...@gmail.com> wrote:
>
> > The problem was if there were indices referencing the column, the
> indices
> > didn't get dropped and recreated afterwards just like foreign
> > key constrains. For primary key columns, it's the primary key constrain
> > needs to be take care of (drop before alter the column and recreate
> > afterwards).
>
> DdlUtils will drop nothing automatically if you're using the API, you
> have to remove constraints and index yourself from the model.
> When using the Ant tasks, the target schema must be a valid schema, so
> it cannot contain e.g. foreign keys using non-existing columns.
>
> Tom
>
--
--------------
Cheers,
Jun
Re: Alter column issue.
Posted by Thomas Dudziak <to...@gmail.com>.
On 1/29/07, Jun Li <al...@gmail.com> wrote:
> The problem was if there were indices referencing the column, the indices
> didn't get dropped and recreated afterwards just like foreign
> key constrains. For primary key columns, it's the primary key constrain
> needs to be take care of (drop before alter the column and recreate
> afterwards).
DdlUtils will drop nothing automatically if you're using the API, you
have to remove constraints and index yourself from the model.
When using the Ant tasks, the target schema must be a valid schema, so
it cannot contain e.g. foreign keys using non-existing columns.
Tom