topos-create.sql 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. CREATE TABLE topos_d (
  2. id SERIAL PRIMARY KEY NOT NULL,
  3. rectime TIMESTAMP WITHOUT TIME ZONE NOT NULL,
  4. s_method VARCHAR(64) DEFAULT '' NOT NULL,
  5. s_cseq VARCHAR(64) DEFAULT '' NOT NULL,
  6. a_callid VARCHAR(255) DEFAULT '' NOT NULL,
  7. a_uuid VARCHAR(255) DEFAULT '' NOT NULL,
  8. b_uuid VARCHAR(255) DEFAULT '' NOT NULL,
  9. a_contact VARCHAR(128) DEFAULT '' NOT NULL,
  10. b_contact VARCHAR(128) DEFAULT '' NOT NULL,
  11. as_contact VARCHAR(128) DEFAULT '' NOT NULL,
  12. bs_contact VARCHAR(128) DEFAULT '' NOT NULL,
  13. a_tag VARCHAR(64) DEFAULT '' NOT NULL,
  14. b_tag VARCHAR(64) DEFAULT '' NOT NULL,
  15. a_rr TEXT DEFAULT '' NOT NULL,
  16. b_rr TEXT DEFAULT '' NOT NULL,
  17. iflags INTEGER DEFAULT 0 NOT NULL,
  18. a_uri VARCHAR(128) DEFAULT '' NOT NULL,
  19. b_uri VARCHAR(128) DEFAULT '' NOT NULL,
  20. r_uri VARCHAR(128) DEFAULT '' NOT NULL,
  21. a_srcip VARCHAR(50) DEFAULT '' NOT NULL,
  22. b_srcip VARCHAR(50) DEFAULT '' NOT NULL
  23. );
  24. CREATE INDEX topos_d_rectime_idx ON topos_d (rectime);
  25. CREATE INDEX topos_d_a_callid_idx ON topos_d (a_callid);
  26. INSERT INTO version (table_name, table_version) values ('topos_d','1');
  27. CREATE TABLE topos_t (
  28. id SERIAL PRIMARY KEY NOT NULL,
  29. rectime TIMESTAMP WITHOUT TIME ZONE NOT NULL,
  30. s_method VARCHAR(64) DEFAULT '' NOT NULL,
  31. s_cseq VARCHAR(64) DEFAULT '' NOT NULL,
  32. a_callid VARCHAR(255) DEFAULT '' NOT NULL,
  33. a_uuid VARCHAR(255) DEFAULT '' NOT NULL,
  34. b_uuid VARCHAR(255) DEFAULT '' NOT NULL,
  35. direction INTEGER DEFAULT 0 NOT NULL,
  36. x_via TEXT DEFAULT '' NOT NULL,
  37. x_vbranch VARCHAR(255) DEFAULT '' NOT NULL,
  38. x_rr TEXT DEFAULT '' NOT NULL,
  39. x_uri VARCHAR(128) DEFAULT '' NOT NULL,
  40. x_tag VARCHAR(64) DEFAULT '' NOT NULL
  41. );
  42. CREATE INDEX topos_t_rectime_idx ON topos_t (rectime);
  43. CREATE INDEX topos_t_a_callid_idx ON topos_t (a_callid);
  44. INSERT INTO version (table_name, table_version) values ('topos_t','1');