aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-03-28 16:31:37 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-03-28 16:31:37 +0300
commit117f31125d4d1e39f6bf639360ff37a44664dbb2 (patch)
treec9ce313e6f7d2d82ac0f1543354ec86c2cbb978e /sql
parentFix PEP issues (#1636) (diff)
Add SQL as router RAM backend
Diffstat (limited to 'sql')
-rw-r--r--sql/lite.sql11
-rw-r--r--sql/mssql.sql14
-rw-r--r--sql/mysql.sql11
-rw-r--r--sql/pg.sql11
4 files changed, 47 insertions, 0 deletions
diff --git a/sql/lite.sql b/sql/lite.sql
index 3e9231768..bc6a6e706 100644
--- a/sql/lite.sql
+++ b/sql/lite.sql
@@ -319,3 +319,14 @@ CREATE TABLE oauth_token (
scope text NOT NULL,
expire bigint NOT NULL
);
+
+CREATE TABLE route (
+ domain text NOT NULL,
+ server_host text NOT NULL,
+ node text NOT NULL,
+ pid text NOT NULL,
+ local_hint text NOT NULL
+);
+
+CREATE UNIQUE INDEX i_route ON route(domain, server_host, node, pid);
+CREATE INDEX i_route_domain ON route(domain);
diff --git a/sql/mssql.sql b/sql/mssql.sql
index a3b814e02..06f73aea9 100644
--- a/sql/mssql.sql
+++ b/sql/mssql.sql
@@ -490,3 +490,17 @@ CREATE TABLE [dbo].[oauth_token] (
[token] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
) TEXTIMAGE_ON [PRIMARY];
+
+CREATE TABLE [dbo].[route] (
+ [domain] [varchar] (255) NOT NULL,
+ [server_host] [varchar] (255) NOT NULL,
+ [node] [varchar] (255) NOT NULL,
+ [pid] [varchar](100) NOT NULL,
+ [local_hint] text NOT NULL
+);
+
+CREATE UNIQUE CLUSTERED INDEX [route_i] ON [route] (domain, server_host, node, pid)
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
+
+CREATE INDEX [route_domain] ON [route] (domain)
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
diff --git a/sql/mysql.sql b/sql/mysql.sql
index 9b2114ae5..c4f3d1f02 100644
--- a/sql/mysql.sql
+++ b/sql/mysql.sql
@@ -335,3 +335,14 @@ CREATE TABLE oauth_token (
scope text NOT NULL,
expire bigint NOT NULL
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
+
+CREATE TABLE route (
+ domain text NOT NULL,
+ server_host text NOT NULL,
+ node text NOT NULL,
+ pid text NOT NULL,
+ local_hint text NOT NULL
+) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
+
+CREATE UNIQUE INDEX i_route ON route(domain(75), server_host(75), node(75), pid(75));
+CREATE INDEX i_route_domain ON route(domain(75));
diff --git a/sql/pg.sql b/sql/pg.sql
index 2ce9d1379..fac806e8a 100644
--- a/sql/pg.sql
+++ b/sql/pg.sql
@@ -339,3 +339,14 @@ CREATE TABLE oauth_token (
);
CREATE UNIQUE INDEX i_oauth_token_token ON oauth_token USING btree (token);
+
+CREATE TABLE route (
+ domain text NOT NULL,
+ server_host text NOT NULL,
+ node text NOT NULL,
+ pid text NOT NULL,
+ local_hint text NOT NULL
+);
+
+CREATE UNIQUE INDEX i_route ON route USING btree (domain, server_host, node, pid);
+CREATE INDEX i_route_domain ON route USING btree (domain);