Hi,

H2 simply drops the constraint as well in this case. I understand this is
not how other databases work, this should be changed. H2 supports "drop ...
restrict" and "cascade", but currently ignores it. Patches are welcome!

Regards,
Thomas

On Monday, April 27, 2015, cmarquesumu <cmarques...@gmail.com> wrote:

> I am starting in H2, because I'm planning on using it in an application in
> java swing that i'm starting to develop.
> I created a database with two tables (A and B), where B have foreign key
> of A. To my surprise, I'm managing to eliminate (DROP TABLE) the table A
> without any H2 error message, even with SET REFERENTIAL_INTEGRITY TRUE .
> Where am I going wrong?
>
> I'm using h2-1.4.187.jar and when the browser opens, I put the following
> script to run and I get no error.
>
> Thanks for attention.
>
>
> set referential_integrity true;
>
> create table A (id integer not null primary key, name varchar(50));
> create table B (id integer not null primary key, name varchar(50), idA
> integer not null, foreign key (idA) references A);
>
> insert into A values (1, 'Parana');
> insert into B values (2, 'Umuarama', 1);
>
> drop table A;
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to h2-database+unsubscr...@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','h2-database%2bunsubscr...@googlegroups.com');>
> .
> To post to this group, send email to h2-database@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','h2-database@googlegroups.com');>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to