
    create table WEBINTERFACE (
        [UUID] uniqueidentifier not null,
        [NAME] varchar(100),
        [ACTIVE] numeric(5,0),
        [URL] varchar(200),
        [API_KEY] varchar(40),
        [GET_IMPLEMENTATION] varchar(200),
        [GET_ENTITY] uniqueidentifier,
        [POST_IMPLEMENTATION] varchar(200),
        [POST_ENTITY] uniqueidentifier,
        [PUT_IMPLEMENTATION] varchar(200),
        [PUT_ENTITY] uniqueidentifier,
        [DELETE_IMPLEMENTATION] varchar(200),
        [DELETE_ENTITY] uniqueidentifier,
        [CREATED_ON] datetime2,
        [MODIFIED_ON] datetime2,
        [RWDU] numeric(5,0),
        [CREATED_BY] varchar(20),
        [MODIFIED_BY] varchar(20),
        [OWN_LIC] varchar(4),
        [OPC] varchar(8),
        [OWNER] numeric(5,0),
        [GROUP] numeric(5,0),
        [ANY] numeric(5,0),
        [WEBHASH] uniqueidentifier,
        [LOGLEVEL] numeric(10,0)
    );

    IF NOT EXISTS (SELECT * FROM SYS.INDEXES
       WHERE IS_PRIMARY_KEY = 1 AND OBJECT_ID IN
             (SELECT OBJECT_ID FROM SYS.TABLES WHERE NAME = 'WEBINTERFACE'))
       alter table WEBINTERFACE add constraint PID590DT590 primary key ([UUID]);

    alter table WEBINTERFACE
        add constraint DT590UUID_DEFAULT DEFAULT newid() FOR [UUID];

    alter table WEBINTERFACE
        add constraint DT590UUID_NOT_NULL check([UUID] is not null);

    alter table WEBINTERFACE
        add constraint DT590DI064145_DEFAULT DEFAULT 0 FOR [ACTIVE];

    alter table WEBINTERFACE
        add constraint DT590DI064286_DEFAULT DEFAULT CONVERT(datetime2,'01.01.1970',104) FOR [CREATED_ON];

    alter table WEBINTERFACE
        add constraint DT590DI064285_DEFAULT DEFAULT CONVERT(datetime2,'01.01.1970',104) FOR [MODIFIED_ON];

    alter table WEBINTERFACE
        add constraint DT590DI064284_DEFAULT DEFAULT 0 FOR [RWDU];

    alter table WEBINTERFACE
        add constraint DT590DI064279_DEFAULT DEFAULT 0 FOR [OWNER];

    alter table WEBINTERFACE
        add constraint DT590DI064278_DEFAULT DEFAULT 0 FOR [GROUP];

    alter table WEBINTERFACE
        add constraint DT590DI064277_DEFAULT DEFAULT 0 FOR [ANY];

    alter table WEBINTERFACE
        add constraint DT590DI064674_DEFAULT DEFAULT 0 FOR [LOGLEVEL];

    create table WEBATTRPARA (
        [UUID] uniqueidentifier not null,
        [WEB_ATTRIBUTE] uniqueidentifier,
        [NAME] varchar(100),
        [VALUE] varchar(1000),
        [POSITION] numeric(5,0),
        [CREATED_ON] datetime2,
        [MODIFIED_ON] datetime2,
        [RWDU] numeric(5,0),
        [CREATED_BY] varchar(20),
        [MODIFIED_BY] varchar(20),
        [OWN_LIC] varchar(4),
        [OPC] varchar(8),
        [OWNER] numeric(5,0),
        [GROUP] numeric(5,0),
        [ANY] numeric(5,0)
    );

    IF NOT EXISTS (SELECT * FROM SYS.INDEXES
       WHERE IS_PRIMARY_KEY = 1 AND OBJECT_ID IN
             (SELECT OBJECT_ID FROM SYS.TABLES WHERE NAME = 'WEBATTRPARA'))
       alter table WEBATTRPARA add constraint PID591DT591 primary key ([UUID]);

    alter table WEBATTRPARA
        add constraint DT591UUID_DEFAULT DEFAULT newid() FOR [UUID];

    alter table WEBATTRPARA
        add constraint DT591UUID_NOT_NULL check([UUID] is not null);

    alter table WEBATTRPARA
        add constraint DT591DI064349_DEFAULT DEFAULT 0 FOR [POSITION];

    alter table WEBATTRPARA
        add constraint DT591DI064359_DEFAULT DEFAULT CONVERT(datetime2,'01.01.1970',104) FOR [CREATED_ON];

    alter table WEBATTRPARA
        add constraint DT591DI064358_DEFAULT DEFAULT CONVERT(datetime2,'01.01.1970',104) FOR [MODIFIED_ON];

    alter table WEBATTRPARA
        add constraint DT591DI064357_DEFAULT DEFAULT 0 FOR [RWDU];

    alter table WEBATTRPARA
        add constraint DT591DI064352_DEFAULT DEFAULT 0 FOR [OWNER];

    alter table WEBATTRPARA
        add constraint DT591DI064351_DEFAULT DEFAULT 0 FOR [GROUP];

    alter table WEBATTRPARA
        add constraint DT591DI064350_DEFAULT DEFAULT 0 FOR [ANY];

    create table WEBENTITY (
        [UUID] uniqueidentifier not null,
        [DATATABLE] varchar(4),
        [NAME] varchar(400),
        [CREATED_ON] datetime2,
        [MODIFIED_ON] datetime2,
        [RWDU] numeric(5,0),
        [CREATED_BY] varchar(20),
        [MODIFIED_BY] varchar(20),
        [OWN_LIC] varchar(4),
        [OPC] varchar(8),
        [OWNER] numeric(5,0),
        [GROUP] numeric(5,0),
        [ANY] numeric(5,0)
    );

    IF NOT EXISTS (SELECT * FROM SYS.INDEXES
       WHERE IS_PRIMARY_KEY = 1 AND OBJECT_ID IN
             (SELECT OBJECT_ID FROM SYS.TABLES WHERE NAME = 'WEBENTITY'))
       alter table WEBENTITY add constraint PID592DT592 primary key ([UUID]);

    alter table WEBENTITY with nocheck
        add constraint FKWEBENTITYID415
        foreign key ([DATATABLE])
        references DT415
        on delete no action;
    CREATE TRIGGER UFKWEBENTITYID415 ON DT415
        FOR DELETE
        AS
        BEGIN
            DELETE t
            FROM DELETED d
                INNER JOIN WEBENTITY t ON d.DI000265 = t.DATATABLE
        END;
    alter table WEBENTITY with check check constraint FKWEBENTITYID415;

    create index IDX_WEBENTITYID415 on WEBENTITY ([DATATABLE]);

    alter table WEBENTITY
        add constraint DT592UUID_DEFAULT DEFAULT newid() FOR [UUID];

    alter table WEBENTITY
        add constraint DT592UUID_NOT_NULL check([UUID] is not null);

    alter table WEBENTITY
        add constraint DT592DATATABLE_NOT_NULL check([DATATABLE] is not null);

    alter table WEBENTITY
        add constraint DT592DI064372_DEFAULT DEFAULT CONVERT(datetime2,'01.01.1970',104) FOR [CREATED_ON];

    alter table WEBENTITY
        add constraint DT592DI064373_DEFAULT DEFAULT CONVERT(datetime2,'01.01.1970',104) FOR [MODIFIED_ON];

    alter table WEBENTITY
        add constraint DT592DI064374_DEFAULT DEFAULT 0 FOR [RWDU];

    alter table WEBENTITY
        add constraint DT592DI064379_DEFAULT DEFAULT 0 FOR [OWNER];

    alter table WEBENTITY
        add constraint DT592DI064380_DEFAULT DEFAULT 0 FOR [GROUP];

    alter table WEBENTITY
        add constraint DT592DI064381_DEFAULT DEFAULT 0 FOR [ANY];

    create table WEBATTRIBUTE (
        [UUID] uniqueidentifier not null,
        [WEB_ENTITY] uniqueidentifier,
        [DATAITEM] varchar(6),
        [MANDATORY] numeric(5,0),
        [NAME] varchar(80),
        [TRANSFORMER] varchar(120),
        [CREATED_ON] datetime2,
        [MODIFIED_ON] datetime2,
        [RWDU] numeric(5,0),
        [CREATED_BY] varchar(20),
        [MODIFIED_BY] varchar(20),
        [OWN_LIC] varchar(4),
        [OPC] varchar(8),
        [OWNER] numeric(5,0),
        [GROUP] numeric(5,0),
        [ANY] numeric(5,0)
    );

    IF NOT EXISTS (SELECT * FROM SYS.INDEXES
       WHERE IS_PRIMARY_KEY = 1 AND OBJECT_ID IN
             (SELECT OBJECT_ID FROM SYS.TABLES WHERE NAME = 'WEBATTRIBUTE'))
       alter table WEBATTRIBUTE add constraint PID593DT593 primary key ([UUID]);

    alter table WEBATTRIBUTE with nocheck
        add constraint FKWEBATTRIBUTEID592
        foreign key ([WEB_ENTITY])
        references WEBENTITY
        on delete no action;
    CREATE TRIGGER UFKWEBATTRIBUTEID592 ON WEBENTITY
        FOR DELETE
        AS
        BEGIN
            DELETE t
            FROM DELETED d
                INNER JOIN WEBATTRIBUTE t ON d.UUID = t.WEB_ENTITY
        END;
    alter table WEBATTRIBUTE with check check constraint FKWEBATTRIBUTEID592;

    create index IDX_WEBATTRIBUTEID592 on WEBATTRIBUTE ([WEB_ENTITY]);

    alter table WEBATTRIBUTE
        add constraint DT593UUID_DEFAULT DEFAULT newid() FOR [UUID];

    alter table WEBATTRIBUTE
        add constraint DT593UUID_NOT_NULL check([UUID] is not null);

    alter table WEBATTRIBUTE
        add constraint DT593WEB_ENTITY_NOT_NULL check([WEB_ENTITY] is not null);

    alter table WEBATTRIBUTE
        add constraint DT593DI064149_DEFAULT DEFAULT 0 FOR [MANDATORY];

    alter table WEBATTRIBUTE
        add constraint DT593DI064382_DEFAULT DEFAULT CONVERT(datetime2,'01.01.1970',104) FOR [CREATED_ON];

    alter table WEBATTRIBUTE
        add constraint DT593DI064383_DEFAULT DEFAULT CONVERT(datetime2,'01.01.1970',104) FOR [MODIFIED_ON];

    alter table WEBATTRIBUTE
        add constraint DT593DI064384_DEFAULT DEFAULT 0 FOR [RWDU];

    alter table WEBATTRIBUTE
        add constraint DT593DI064389_DEFAULT DEFAULT 0 FOR [OWNER];

    alter table WEBATTRIBUTE
        add constraint DT593DI064390_DEFAULT DEFAULT 0 FOR [GROUP];

    alter table WEBATTRIBUTE
        add constraint DT593DI064391_DEFAULT DEFAULT 0 FOR [ANY];

    create table WEBPARAMETER (
        [UUID] uniqueidentifier not null,
        [WEB_INTERFACE] uniqueidentifier,
        [NAME] varchar(80),
        [APPLY_TO] varchar(6),
        [FILTER_TYPE] numeric(10,0),
        [CREATED_ON] datetime2,
        [MODIFIED_ON] datetime2,
        [RWDU] numeric(5,0),
        [CREATED_BY] varchar(20),
        [MODIFIED_BY] varchar(20),
        [OWN_LIC] varchar(4),
        [OPC] varchar(8),
        [OWNER] numeric(5,0),
        [GROUP] numeric(5,0),
        [ANY] numeric(5,0),
        [POSITION] numeric(5,0)
    );

    IF NOT EXISTS (SELECT * FROM SYS.INDEXES
       WHERE IS_PRIMARY_KEY = 1 AND OBJECT_ID IN
             (SELECT OBJECT_ID FROM SYS.TABLES WHERE NAME = 'WEBPARAMETER'))
       alter table WEBPARAMETER add constraint PID594DT594 primary key ([UUID]);

    alter table WEBPARAMETER with nocheck
        add constraint FKWEBPARAMETERID590
        foreign key ([WEB_INTERFACE])
        references WEBINTERFACE
        on delete no action;
    CREATE TRIGGER UFKWEBPARAMETERID590 ON WEBINTERFACE
        FOR DELETE
        AS
        BEGIN
            DELETE t
            FROM DELETED d
                INNER JOIN WEBPARAMETER t ON d.UUID = t.WEB_INTERFACE
        END;
    alter table WEBPARAMETER with check check constraint FKWEBPARAMETERID590;

    create index IDX_WEBPARAMETERID590 on WEBPARAMETER ([WEB_INTERFACE]);

    alter table WEBPARAMETER
        add constraint DT594UUID_DEFAULT DEFAULT newid() FOR [UUID];

    alter table WEBPARAMETER
        add constraint DT594UUID_NOT_NULL check([UUID] is not null);

    alter table WEBPARAMETER
        add constraint DT594WEB_INTERFACE_NOT_NULL check([WEB_INTERFACE] is not null);

    alter table WEBPARAMETER
        add constraint DT594DI064155_DEFAULT DEFAULT 0 FOR [FILTER_TYPE];

    alter table WEBPARAMETER
        add constraint DT594DI064392_DEFAULT DEFAULT CONVERT(datetime2,'01.01.1970',104) FOR [CREATED_ON];

    alter table WEBPARAMETER
        add constraint DT594DI064393_DEFAULT DEFAULT CONVERT(datetime2,'01.01.1970',104) FOR [MODIFIED_ON];

    alter table WEBPARAMETER
        add constraint DT594DI064394_DEFAULT DEFAULT 0 FOR [RWDU];

    alter table WEBPARAMETER
        add constraint DT594DI064399_DEFAULT DEFAULT 0 FOR [OWNER];

    alter table WEBPARAMETER
        add constraint DT594DI064400_DEFAULT DEFAULT 0 FOR [GROUP];

    alter table WEBPARAMETER
        add constraint DT594DI064411_DEFAULT DEFAULT 0 FOR [ANY];

    alter table WEBPARAMETER
        add constraint DT594DI064434_DEFAULT DEFAULT 0 FOR [POSITION];

    create table WEBREQUEST (
        [UUID] uniqueidentifier not null,
        [WEB_INTERFACE] uniqueidentifier,
        [TIMESTAMP] varchar(20),
        [SUCCESS] numeric(5,0),
        [DURATION] numeric(10,0),
        [METHOD] varchar(20)
    );

    IF NOT EXISTS (SELECT * FROM SYS.INDEXES
       WHERE IS_PRIMARY_KEY = 1 AND OBJECT_ID IN
             (SELECT OBJECT_ID FROM SYS.TABLES WHERE NAME = 'WEBREQUEST'))
       alter table WEBREQUEST add constraint PID595DT595 primary key ([UUID]);

    alter table WEBREQUEST with nocheck
        add constraint FKWEBREQUESTID590
        foreign key ([WEB_INTERFACE])
        references WEBINTERFACE
        on delete no action;
    CREATE TRIGGER UFKWEBREQUESTID590 ON WEBINTERFACE
        FOR DELETE
        AS
        BEGIN
            DELETE t
            FROM DELETED d
                INNER JOIN WEBREQUEST t ON d.UUID = t.WEB_INTERFACE
        END;
    alter table WEBREQUEST with check check constraint FKWEBREQUESTID590;

    create index IDX_WEBREQUESTID590 on WEBREQUEST ([WEB_INTERFACE]);

    alter table WEBREQUEST
        add constraint DT595UUID_DEFAULT DEFAULT newid() FOR [UUID];

    alter table WEBREQUEST
        add constraint DT595UUID_NOT_NULL check([UUID] is not null);

    alter table WEBREQUEST
        add constraint DT595DI064715_DEFAULT DEFAULT 0 FOR [SUCCESS];

    alter table WEBREQUEST
        add constraint DT595DI064716_DEFAULT DEFAULT 0 FOR [DURATION];

    create table WEBLOGGING (
        [UUID] uniqueidentifier not null,
        [REQUEST] uniqueidentifier,
        [TEXT] varchar(4000),
        [LOGLEVEL] numeric(10,0),
        [TIMESTAMP] varchar(20),
        [POSITION] numeric(10,0)
    );

    IF NOT EXISTS (SELECT * FROM SYS.INDEXES
       WHERE IS_PRIMARY_KEY = 1 AND OBJECT_ID IN
             (SELECT OBJECT_ID FROM SYS.TABLES WHERE NAME = 'WEBLOGGING'))
       alter table WEBLOGGING add constraint PID596DT596 primary key ([UUID]);

    alter table WEBLOGGING with nocheck
        add constraint FKWEBLOGGINGID595
        foreign key ([REQUEST])
        references WEBREQUEST
        on delete no action;
    CREATE TRIGGER UFKWEBLOGGINGID595 ON WEBREQUEST
        FOR DELETE
        AS
        BEGIN
            DELETE t
            FROM DELETED d
                INNER JOIN WEBLOGGING t ON d.UUID = t.REQUEST
        END;
    alter table WEBLOGGING with check check constraint FKWEBLOGGINGID595;

    create index IDX_WEBLOGGINGID595 on WEBLOGGING ([REQUEST]);

    alter table WEBLOGGING
        add constraint DT596UUID_DEFAULT DEFAULT newid() FOR [UUID];

    alter table WEBLOGGING
        add constraint DT596UUID_NOT_NULL check([UUID] is not null);

    alter table WEBLOGGING
        add constraint DT596DI064618_DEFAULT DEFAULT 0 FOR [LOGLEVEL];

    alter table WEBLOGGING
        add constraint DT596DI064616_DEFAULT DEFAULT 0 FOR [POSITION];
