Quantcast

Disable constraint

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Disable constraint

rahulyadav
This post has NOT been accepted by the mailing list yet.
Is there an equivalent to Oracle's Disable Constraint in HSQL.
I know we can drop them but that doesn't server my purpose.
I want to disable unique constraints.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Disable constraint

alero
This post has NOT been accepted by the mailing list yet.
Hi.

We have the same issue as we maintain the database with Liquibase meaning alot of alter commands running. The problem is that hsqldb does not support changes on columns with constraints.

An example is that all the primary keys was changed to bigint from int.
Luquibase generates the command: "ALTER TABLE a_user ALTER COLUMN id BIGINT"
This operation is not possible on hsql as it fails with "is referenced by FOREIGN KEY constraint: <name>"
We use postgresql on production and it works for that (have not investigated why)

I have also manually tried with "alter table a_user alter column id SET DATA TYPE bigint" it fails wit the same error.

We cannot drop and recreate all constraints, its a massive workload. We just need to disable the control for while the operations are running then reactivate it again.

Have tried "SET DATABASE REFERENTIAL INTEGRITY FALSE" but same error persists and I assume this only affects the data not the datatype constraint.
Loading...