[sr-dev] git:master: modules_k/p_usrloc:Fixed sql table creation scheme

Marius Zbihlei marius.zbihlei at 1and1.ro
Wed Mar 21 17:48:27 CET 2012


Module: sip-router
Branch: master
Commit: d8fc55f0dec978a09bfd1aead4be55e2a1855d91
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d8fc55f0dec978a09bfd1aead4be55e2a1855d91

Author: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Date:   Wed Mar 21 18:45:36 2012 +0200

modules_k/p_usrloc:Fixed sql table creation scheme

TODO: create serdb schema definition

Patch by Dragos Dinu (Dragos.Dinu AT 1and1.ro

---

 modules_k/p_usrloc/location.sql |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/modules_k/p_usrloc/location.sql b/modules_k/p_usrloc/location.sql
index d8203a7..a80902a 100644
--- a/modules_k/p_usrloc/location.sql
+++ b/modules_k/p_usrloc/location.sql
@@ -1,20 +1,22 @@
-drop table location;
+drop table if exists location;
 CREATE TABLE location (
-username VARCHAR(64) NOT NULL,
-aor VARCHAR(255) NOT NULL,
-contact VARCHAR(255) NOT NULL,
-server_id INT NOT NULL DEFAULT '0',
-received VARCHAR(255),
-expires DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
-q FLOAT NOT NULL DEFAULT '1.0',
-callid VARCHAR(255),
-cseq INT UNSIGNED,
-flags INT UNSIGNED NOT NULL DEFAULT '0',
-cflags INT UNSIGNED NOT NULL DEFAULT '0',
-user_agent VARCHAR(64),
-instance VARCHAR(255),
-UNIQUE KEY location_key (username, contact),
-KEY location_contact (contact),
-KEY location_expires (expires)
-);
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    username VARCHAR(64) DEFAULT '' NOT NULL,
+    domain VARCHAR(64) DEFAULT NULL,
+    contact VARCHAR(255) DEFAULT '' NOT NULL,
+    received VARCHAR(128) DEFAULT NULL,
+    path VARCHAR(128) DEFAULT NULL,
+    expires DATETIME DEFAULT '2020-05-28 21:32:15' NOT NULL,
+    q FLOAT(10,2) DEFAULT 1.0 NOT NULL,
+    callid VARCHAR(255) DEFAULT 'Default-Call-ID' NOT NULL,
+    cseq INT(11) DEFAULT 1 NOT NULL,
+    last_modified DATETIME DEFAULT '1900-01-01 00:00:01' NOT NULL,
+    flags INT(11) DEFAULT 0 NOT NULL,
+    cflags INT(11) DEFAULT 0 NOT NULL,
+    user_agent VARCHAR(255) DEFAULT '' NOT NULL,
+    socket VARCHAR(64) DEFAULT NULL,
+    methods INT(11) DEFAULT NULL
+) ENGINE=MyISAM;
+
+CREATE INDEX account_contact_idx ON location (username, domain, contact);
 




More information about the sr-dev mailing list