tools/oracle/acc-create.sql
4a81660c
 INSERT INTO version (table_name, table_version) values ('acc','4');
 CREATE TABLE acc (
     id NUMBER(10) PRIMARY KEY,
     method VARCHAR2(16) DEFAULT '',
     from_tag VARCHAR2(64) DEFAULT '',
     to_tag VARCHAR2(64) DEFAULT '',
     callid VARCHAR2(64) DEFAULT '',
     sip_code VARCHAR2(3) DEFAULT '',
     sip_reason VARCHAR2(32) DEFAULT '',
     time DATE
38fac614
 );
4a81660c
 
 CREATE OR REPLACE TRIGGER acc_tr
38fac614
 before insert on acc FOR EACH ROW
 BEGIN
   auto_id(:NEW.id);
 END acc_tr;
 /
4a81660c
 BEGIN map2users('acc'); END;
38fac614
 /
4a81660c
 CREATE INDEX acc_callid_idx  ON acc (callid);
38fac614
 
4a81660c
 INSERT INTO version (table_name, table_version) values ('missed_calls','3');
 CREATE TABLE missed_calls (
     id NUMBER(10) PRIMARY KEY,
     method VARCHAR2(16) DEFAULT '',
     from_tag VARCHAR2(64) DEFAULT '',
     to_tag VARCHAR2(64) DEFAULT '',
     callid VARCHAR2(64) DEFAULT '',
     sip_code VARCHAR2(3) DEFAULT '',
     sip_reason VARCHAR2(32) DEFAULT '',
     time DATE
38fac614
 );
4a81660c
 
 CREATE OR REPLACE TRIGGER missed_calls_tr
38fac614
 before insert on missed_calls FOR EACH ROW
 BEGIN
   auto_id(:NEW.id);
 END missed_calls_tr;
 /
4a81660c
 BEGIN map2users('missed_calls'); END;
38fac614
 /
4a81660c
 CREATE INDEX missed_calls_callid_idx  ON missed_calls (callid);