summaryrefslogtreecommitdiff
path: root/SQL
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-02-24 19:46:13 +0000
committeralecpl <alec@alec.pl>2010-02-24 19:46:13 +0000
commit951c07b1b16e1635f4563239cf55664a92b7c290 (patch)
tree75cd0a84f9992a3ceb0eb55fd27cfedbce2cb34e /SQL
parent7481dd903e1ee80e6697ba1a73daa6ec740702ff (diff)
- Fix adding contacts SQL error on mysql (#1486459)
Diffstat (limited to 'SQL')
-rw-r--r--SQL/mysql.initial.sql6
-rw-r--r--SQL/mysql.update.sql4
2 files changed, 7 insertions, 3 deletions
diff --git a/SQL/mysql.initial.sql b/SQL/mysql.initial.sql
index cca908899..25d11b50f 100644
--- a/SQL/mysql.initial.sql
+++ b/SQL/mysql.initial.sql
@@ -86,10 +86,10 @@ CREATE TABLE `contacts` (
`contact_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`del` tinyint(1) NOT NULL DEFAULT '0',
- `name` varchar(128) NOT NULL,
+ `name` varchar(128) NOT NULL DEFAULT '',
`email` varchar(128) NOT NULL,
- `firstname` varchar(128) NOT NULL,
- `surname` varchar(128) NOT NULL,
+ `firstname` varchar(128) NOT NULL DEFAULT '',
+ `surname` varchar(128) NOT NULL DEFAULT '',
`vcard` text NULL,
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY(`contact_id`),
diff --git a/SQL/mysql.update.sql b/SQL/mysql.update.sql
index 2e47aeab8..495b600ed 100644
--- a/SQL/mysql.update.sql
+++ b/SQL/mysql.update.sql
@@ -77,4 +77,8 @@ ALTER TABLE `contacts` ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_i
ALTER TABLE `identities` ADD CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) /*!40008 ON DELETE CASCADE ON UPDATE CASCADE */;
+ALTER TABLE `contacts` ALTER `name` SET DEFAULT '';
+ALTER TABLE `contacts` ALTER `firstname` SET DEFAULT '';
+ALTER TABLE `contacts` ALTER `surname` SET DEFAULT '';
+
/*!40014 SET FOREIGN_KEY_CHECKS=1 */;