Hi!

Does anybody knows if ON DELETE CASCADES and ON UPDATE CASCADES is 
supported in H2?

Suppose I have this:

DROP TABLE IF EXISTS SIBS;
CREATE TABLE SIBS (
    NAME VARCHAR(25) NOT NULL,
    SIB_ID VARCHAR(25) NOT NULL,
    CREATION_TIME VARCHAR(25),
    PRIMARY KEY(NAME, SIB_ID)
);

DROP TABLE IF EXISTS GATEWAYS;
CREATE TABLE GATEWAYS (
    ID SMALLINT AUTO_INCREMENT,
    NAME VARCHAR(25) NOT NULL,
    SIB_NAME VARCHAR(25) NOT NULL,
    SIB_ID VARCHAR(25) NOT NULL,
    GW_ID VARCHAR(25) NOT NULL,
    STATUS VARCHAR(20),
    TYPE VARCHAR(20),
    CREATION_TIME VARCHAR(25),
    PRIMARY KEY(ID),
        CONSTRAINT FK_SIB_GW FOREIGN KEY(SIB_NAME, SIB_ID) REFERENCES 
SIBS(NAME, SIB_ID) ON DELETE CASCADES
);

DROP TABLE IF EXISTS GWPROPERTIES;
CREATE TABLE GWPROPERTIES (
    ID SMALLINT AUTO_INCREMENT,
    NAME VARCHAR(25) NOT NULL,
    VALUE VARCHAR(100) NOT NULL,
    PRIMARY KEY(ID),
        CONSTRAINT FK_GW_PROP FOREIGN KEY(ID) REFERENCES GATEWAYS(ID) ON 
DELETE CASCADES
);

Obviously, if a SIB is deleted I want to delete all GATEWAYS associated, 
and the same goes for GWPROPERTIES if a GATEWAY is removed.

I can run some tests obviously, but before I'd like to ask here.

Thanks!
Alejandro

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to