diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-03-30 10:31:51 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-03-30 10:31:51 +0300 |
commit | 31fd83b2aecd0d122d17c4b10d9b39a903da73f3 (patch) | |
tree | a5dcd211037950c898dca02e42f67e49ea4e5d82 /sql | |
parent | oauth_list_tokens and oauth_revoke_token work only in Mnesia (#1644) (diff) |
Add SQL as mod_carboncopy RAM backend
Diffstat (limited to 'sql')
-rw-r--r-- | sql/lite.sql | 10 | ||||
-rw-r--r-- | sql/mssql.sql | 15 | ||||
-rw-r--r-- | sql/mysql.sql | 10 | ||||
-rw-r--r-- | sql/pg.sql | 10 |
4 files changed, 44 insertions, 1 deletions
diff --git a/sql/lite.sql b/sql/lite.sql index 8b59ef0a1..ddfb91ff0 100644 --- a/sql/lite.sql +++ b/sql/lite.sql @@ -359,3 +359,13 @@ CREATE TABLE bosh ( ); CREATE UNIQUE INDEX i_bosh_sid ON bosh(sid); + +CREATE TABLE carboncopy ( + username text NOT NULL, + resource text NOT NULL, + namespace text NOT NULL, + node text NOT NULL +); + +CREATE UNIQUE INDEX i_carboncopy_ur ON carboncopy (username, resource); +CREATE INDEX i_carboncopy_user ON carboncopy (username); diff --git a/sql/mssql.sql b/sql/mssql.sql index 59c192b98..72b490ecc 100644 --- a/sql/mssql.sql +++ b/sql/mssql.sql @@ -520,7 +520,7 @@ CREATE TABLE [dbo].[route] ( [server_host] [varchar] (255) NOT NULL,
[node] [varchar] (255) NOT NULL,
[pid] [varchar](100) NOT NULL,
- [local_hint] text NOT NULL
+ [local_hint] [text] NOT NULL
);
CREATE UNIQUE CLUSTERED INDEX [route_i] ON [route] (domain, server_host, node, pid)
@@ -538,3 +538,16 @@ CREATE TABLE [dbo].[bosh] ( [sid] 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].[carboncopy] (
+ [username] [varchar] (255) NOT NULL,
+ [resource] [varchar] (255) NOT NULL,
+ [namespace] [varchar] (255) NOT NULL,
+ [node] [varchar] (255) NOT NULL
+);
+
+CREATE UNIQUE CLUSTERED INDEX [carboncopy_ur] ON [carboncopy] (username, resource)
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
+
+CREATE INDEX [carboncopy_user] ON [carboncopy] (username)
+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 edd205f0d..e09c39be5 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -375,3 +375,13 @@ CREATE TABLE bosh ( ) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE UNIQUE INDEX i_bosh_sid ON bosh(sid(75)); + +CREATE TABLE carboncopy ( + username text NOT NULL, + resource text NOT NULL, + namespace text NOT NULL, + node text NOT NULL +) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +CREATE UNIQUE INDEX i_carboncopy_ur ON carboncopy (username(75), resource(75)); +CREATE INDEX i_carboncopy_user ON carboncopy (username(75)); diff --git a/sql/pg.sql b/sql/pg.sql index 6c099fc6b..796391c74 100644 --- a/sql/pg.sql +++ b/sql/pg.sql @@ -379,3 +379,13 @@ CREATE TABLE bosh ( ); CREATE UNIQUE INDEX i_bosh_sid ON bosh USING btree (sid); + +CREATE TABLE carboncopy ( + username text NOT NULL, + resource text NOT NULL, + namespace text NOT NULL, + node text NOT NULL +); + +CREATE UNIQUE INDEX i_carboncopy_ur ON carboncopy USING btree (username, resource); +CREATE INDEX i_carboncopy_user ON carboncopy USING btree (username); |