
michael@16: INSERT INTO version (table_name, table_version) values ('gw','8');
michael@16: CREATE TABLE gw (
michael@16:     id NUMBER(10) PRIMARY KEY,
michael@16:     gw_name VARCHAR2(128),
michael@16:     grp_id NUMBER(10),
michael@16:     ip_addr VARCHAR2(15),
michael@16:     port NUMBER(5),
michael@16:     uri_scheme NUMBER(5),
michael@16:     transport NUMBER(5),
michael@16:     strip NUMBER(5),
michael@16:     tag VARCHAR2(16) DEFAULT NULL,
michael@16:     flags NUMBER(10) DEFAULT 0 NOT NULL,
michael@17:     user VARCHAR2(16) DEFAULT NULL,
michael@17:     realm VARCHAR2(16) DEFAULT NULL,
michael@17:     passwd VARCHAR2(16) DEFAULT NULL,
michael@16:     CONSTRAINT gw_gw_name_idx  UNIQUE (gw_name)
michael@16: );
michael@16: 
michael@16: CREATE OR REPLACE TRIGGER gw_tr
michael@16: before insert on gw FOR EACH ROW
michael@16: BEGIN
michael@16:   auto_id(:NEW.id);
michael@16: END gw_tr;
michael@16: /
michael@16: BEGIN map2users('gw'); END;
michael@16: /
michael@16: CREATE INDEX gw_grp_id_idx  ON gw (grp_id);
michael@16: 
michael@16: INSERT INTO version (table_name, table_version) values ('lcr','3');
michael@16: CREATE TABLE lcr (
michael@16:     id NUMBER(10) PRIMARY KEY,
michael@16:     prefix VARCHAR2(16) DEFAULT NULL,
michael@16:     from_uri VARCHAR2(64) DEFAULT NULL,
michael@16:     grp_id NUMBER(10),
michael@16:     priority NUMBER(10)
michael@16: );
michael@16: 
michael@16: CREATE OR REPLACE TRIGGER lcr_tr
michael@16: before insert on lcr FOR EACH ROW
michael@16: BEGIN
michael@16:   auto_id(:NEW.id);
michael@16: END lcr_tr;
michael@16: /
michael@16: BEGIN map2users('lcr'); END;
michael@16: /
michael@16: CREATE INDEX lcr_prefix_idx  ON lcr (prefix);
michael@16: CREATE INDEX lcr_from_uri_idx  ON lcr (from_uri);
michael@16: CREATE INDEX lcr_grp_id_idx  ON lcr (grp_id);
michael@16: 




