summaryrefslogtreecommitdiff
path: root/SQL
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-06-08 13:22:16 +0200
committerAleksander Machniak <alec@alec.pl>2012-06-08 13:24:12 +0200
commit16114e620d0e6781b1d423200b4947eb05bf6afa (patch)
tree7ff30af81652128f934a90d4f7cd94c64d240bfe /SQL
parenta7d5e3e8580466639a18da35af13b97dc3765c16 (diff)
Fix operator incompat. in some queries on contacts table using MS SQL Server (#1488505)
Diffstat (limited to 'SQL')
-rw-r--r--SQL/mssql.initial.sql2
-rw-r--r--SQL/mssql.upgrade.sql9
2 files changed, 10 insertions, 1 deletions
diff --git a/SQL/mssql.initial.sql b/SQL/mssql.initial.sql
index 72c24f126..2ac6aa63e 100644
--- a/SQL/mssql.initial.sql
+++ b/SQL/mssql.initial.sql
@@ -40,7 +40,7 @@ CREATE TABLE [dbo].[contacts] (
[changed] [datetime] NOT NULL ,
[del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
[name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
- [email] [text] COLLATE Latin1_General_CI_AI NOT NULL ,
+ [email] [varchar] (8000) COLLATE Latin1_General_CI_AI NOT NULL ,
[firstname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
[surname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
[vcard] [text] COLLATE Latin1_General_CI_AI NULL ,
diff --git a/SQL/mssql.upgrade.sql b/SQL/mssql.upgrade.sql
index d4a5e41ce..10bae6e47 100644
--- a/SQL/mssql.upgrade.sql
+++ b/SQL/mssql.upgrade.sql
@@ -249,3 +249,12 @@ GO
ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [text] COLLATE Latin1_General_CI_AI NOT NULL
GO
+-- Updates from version 0.8-rc
+
+ALTER TABLE [dbo].[contacts] DROP CONSTRAINT [DF_contacts_email]
+GO
+ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [varchar] (8000) COLLATE Latin1_General_CI_AI NOT NULL
+GO
+ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [DF_contacts_email] DEFAULT ('') FOR [email]
+GO
+ \ No newline at end of file