summaryrefslogtreecommitdiff
path: root/SQL
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-09-06 13:39:45 +0000
committeralecpl <alec@alec.pl>2011-09-06 13:39:45 +0000
commit66df084203a217ab74a416064c459cc3420a648c (patch)
tree2bcd7c9ffde91f22ed4e10ed3fcf780c7de0ab7b /SQL
parenteb2365c47814fd1d142da10ca77ed631bd819a89 (diff)
- Merge devel-spellcheck branch:
- Added spellchecker exceptions dictionary (shared or per-user) - Added possibility to ignore words containing caps, numbers, symbols (spellcheck_ignore_* options)
Diffstat (limited to 'SQL')
-rw-r--r--SQL/mssql.initial.sql10
-rw-r--r--SQL/mssql.upgrade.sql11
-rw-r--r--SQL/mysql.initial.sql11
-rw-r--r--SQL/mysql.update.sql11
-rw-r--r--SQL/postgres.initial.sql13
-rw-r--r--SQL/postgres.update.sql10
-rw-r--r--SQL/sqlite.initial.sql15
-rw-r--r--SQL/sqlite.update.sql10
8 files changed, 91 insertions, 0 deletions
diff --git a/SQL/mssql.initial.sql b/SQL/mssql.initial.sql
index 4aa6fc9f7..321da7cbb 100644
--- a/SQL/mssql.initial.sql
+++ b/SQL/mssql.initial.sql
@@ -93,6 +93,13 @@ CREATE TABLE [dbo].[users] (
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
+CREATE TABLE [dbo].[dictionary] (
+ [user_id] [int] ,
+ [language] [varchar] (5) COLLATE Latin1_General_CI_AI NOT NULL ,
+ [data] [text] COLLATE Latin1_General_CI_AI NOT NULL
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
+GO
+
ALTER TABLE [dbo].[cache] WITH NOCHECK ADD
PRIMARY KEY CLUSTERED
(
@@ -264,6 +271,9 @@ GO
CREATE INDEX [IX_users_alias] ON [dbo].[users]([alias]) ON [PRIMARY]
GO
+CREATE UNIQUE INDEX [IX_dictionary_user_language] ON [dbo].[dictionary]([user_id],[language]) ON [PRIMARY]
+GO
+
ALTER TABLE [dbo].[identities] ADD CONSTRAINT [FK_identities_user_id]
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
ON DELETE CASCADE ON UPDATE CASCADE
diff --git a/SQL/mssql.upgrade.sql b/SQL/mssql.upgrade.sql
index 606db6046..a77362ac4 100644
--- a/SQL/mssql.upgrade.sql
+++ b/SQL/mssql.upgrade.sql
@@ -110,3 +110,14 @@ DELETE FROM [dbo].[messages]
GO
DELETE FROM [dbo].[cache]
GO
+
+-- Updates from version 0.6-stable
+
+CREATE TABLE [dbo].[dictionary] (
+ [user_id] [int] ,
+ [language] [varchar] (5) COLLATE Latin1_General_CI_AI NOT NULL ,
+ [data] [text] COLLATE Latin1_General_CI_AI NOT NULL
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
+GO
+CREATE UNIQUE INDEX [IX_dictionary_user_language] ON [dbo].[dictionary]([user_id],[language]) ON [PRIMARY]
+GO
diff --git a/SQL/mysql.initial.sql b/SQL/mysql.initial.sql
index 14bbb968a..4cabb8132 100644
--- a/SQL/mysql.initial.sql
+++ b/SQL/mysql.initial.sql
@@ -144,4 +144,15 @@ CREATE TABLE `identities` (
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+-- Table structure for table `dictionary`
+
+CREATE TABLE `dictionary` (
+ `user_id` int(10) UNSIGNED DEFAULT NULL,
+ `language` varchar(5) NOT NULL,
+ `data` longtext NOT NULL,
+ CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`)
+ REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ UNIQUE `uniqueness` (`user_id`, `language`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
diff --git a/SQL/mysql.update.sql b/SQL/mysql.update.sql
index ed21bda2e..ee3929c4c 100644
--- a/SQL/mysql.update.sql
+++ b/SQL/mysql.update.sql
@@ -144,3 +144,14 @@ ALTER TABLE `contactgroupmembers` ADD INDEX `contactgroupmembers_contact_index`
TRUNCATE TABLE `messages`;
TRUNCATE TABLE `cache`;
+
+-- Updates from version 0.6-stable
+
+CREATE TABLE `dictionary` (
+ `user_id` int(10) UNSIGNED DEFAULT NULL,
+ `language` varchar(5) NOT NULL,
+ `data` longtext NOT NULL,
+ CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`)
+ REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ UNIQUE `uniqueness` (`user_id`, `language`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
diff --git a/SQL/postgres.initial.sql b/SQL/postgres.initial.sql
index 5350e791f..c801a773c 100644
--- a/SQL/postgres.initial.sql
+++ b/SQL/postgres.initial.sql
@@ -225,3 +225,16 @@ CREATE TABLE messages (
CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx);
CREATE INDEX messages_created_idx ON messages (created);
+
+--
+-- Table "dictionary"
+-- Name: dictionary; Type: TABLE; Schema: public; Owner: postgres
+--
+
+CREATE TABLE dictionary (
+ user_id integer DEFAULT NULL
+ REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
+ "language" varchar(5) NOT NULL,
+ data text NOT NULL,
+ CONSTRAINT dictionary_user_id_language_key UNIQUE (user_id, "language")
+);
diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql
index 94513c53f..0a2ed99dd 100644
--- a/SQL/postgres.update.sql
+++ b/SQL/postgres.update.sql
@@ -100,3 +100,13 @@ CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_
TRUNCATE messages;
TRUNCATE cache;
+
+-- Updates from version 0.6-stable
+
+CREATE TABLE dictionary (
+ user_id integer DEFAULT NULL
+ REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
+ "language" varchar(5) NOT NULL,
+ data text NOT NULL,
+ CONSTRAINT dictionary_user_id_language_key UNIQUE (user_id, "language")
+);
diff --git a/SQL/sqlite.initial.sql b/SQL/sqlite.initial.sql
index d2885e968..337dfbe8d 100644
--- a/SQL/sqlite.initial.sql
+++ b/SQL/sqlite.initial.sql
@@ -146,3 +146,18 @@ CREATE TABLE messages (
CREATE UNIQUE INDEX ix_messages_user_cache_uid ON messages (user_id,cache_key,uid);
CREATE INDEX ix_messages_index ON messages (user_id,cache_key,idx);
CREATE INDEX ix_messages_created ON messages (created);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table dictionary
+--
+
+CREATE TABLE dictionary (
+ user_id integer DEFAULT NULL,
+ "language" varchar(5) NOT NULL,
+ data text NOT NULL
+);
+
+CREATE UNIQUE INDEX ix_dictionary_user_language ON dictionary (user_id, "language");
+
diff --git a/SQL/sqlite.update.sql b/SQL/sqlite.update.sql
index 30c3ae90b..8d5163f47 100644
--- a/SQL/sqlite.update.sql
+++ b/SQL/sqlite.update.sql
@@ -226,3 +226,13 @@ DROP TABLE contacts_tmp;
DELETE FROM messages;
DELETE FROM cache;
CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);
+
+-- Updates from version 0.6-stable
+
+CREATE TABLE dictionary (
+ user_id integer DEFAULT NULL,
+ "language" varchar(5) NOT NULL,
+ data text NOT NULL
+);
+
+CREATE UNIQUE INDEX ix_dictionary_user_language ON dictionary (user_id, "language");