
diff -r 7ae8da2fe7c8 -r c5c55937e44c opensips/scripts/postgres/lcr-create.sql
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/opensips/scripts/postgres/lcr-create.sql	Wed Feb 10 21:14:04 2010 +0100
@@ -0,0 +1,30 @@
+INSERT INTO version (table_name, table_version) values ('gw','8');
+CREATE TABLE gw (
+    id SERIAL PRIMARY KEY NOT NULL,
+    gw_name VARCHAR(128) NOT NULL,
+    grp_id INTEGER NOT NULL,
+    ip_addr VARCHAR(15) NOT NULL,
+    port SMALLINT,
+    uri_scheme SMALLINT,
+    transport SMALLINT,
+    strip SMALLINT,
+    tag VARCHAR(16) DEFAULT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT gw_gw_name_idx UNIQUE (gw_name)
+);
+
+CREATE INDEX gw_grp_id_idx ON gw (grp_id);
+
+INSERT INTO version (table_name, table_version) values ('lcr','3');
+CREATE TABLE lcr (
+    id SERIAL PRIMARY KEY NOT NULL,
+    prefix VARCHAR(16) DEFAULT NULL,
+    from_uri VARCHAR(64) DEFAULT NULL,
+    grp_id INTEGER NOT NULL,
+    priority INTEGER NOT NULL
+);
+
+CREATE INDEX lcr_prefix_idx ON lcr (prefix);
+CREATE INDEX lcr_from_uri_idx ON lcr (from_uri);
+CREATE INDEX lcr_grp_id_idx ON lcr (grp_id);
+




