From 4ea494ea0f3c87476780621fcf4e7beaa3733aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Schneider?= Date: Sun, 7 Jul 2013 18:05:24 +0200 Subject: [PATCH] Updated database definition to match SabreDAV 1.8.6 --- Core/Resources/Db/MySQL/db.sql | 133 +++++++++++++++-------------- Core/Resources/Db/SQLite/db.sql | 83 ++++++++++++++++++ Core/Resources/Db/SQLite/db.sqlite | Bin 14336 -> 14336 bytes 3 files changed, 150 insertions(+), 66 deletions(-) create mode 100644 Core/Resources/Db/SQLite/db.sql diff --git a/Core/Resources/Db/MySQL/db.sql b/Core/Resources/Db/MySQL/db.sql index c3dd2dc..0a23b1d 100644 --- a/Core/Resources/Db/MySQL/db.sql +++ b/Core/Resources/Db/MySQL/db.sql @@ -1,88 +1,89 @@ -# -# This is the empty database schema for Baïkal -# Corresponds to the MySQL Schema definition of project SabreDAV 1.6.4 -# http://code.google.com/p/sabredav/ -# +-- +-- This is the empty database schema for Baïkal +-- Corresponds to the MySQL Schema definition of project SabreDAV 1.8.6 +-- http://code.google.com/p/sabredav/ +-- CREATE TABLE IF NOT EXISTS users ( - id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, - username VARCHAR(50), - digesta1 VARCHAR(32), - UNIQUE(username) + id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + username VARCHAR(50), + digesta1 VARCHAR(32), + UNIQUE(username) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE IF NOT EXISTS principals ( - id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, - uri VARCHAR(200) NOT NULL, - email VARCHAR(80), - displayname VARCHAR(80), - vcardurl VARCHAR(80), - UNIQUE(uri) + id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + uri VARCHAR(200) NOT NULL, + email VARCHAR(80), + displayname VARCHAR(80), + vcardurl VARCHAR(255), + UNIQUE(uri) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE IF NOT EXISTS groupmembers ( - id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, - principal_id INTEGER UNSIGNED NOT NULL, - member_id INTEGER UNSIGNED NOT NULL, - UNIQUE(principal_id, member_id) + id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + principal_id INTEGER UNSIGNED NOT NULL, + member_id INTEGER UNSIGNED NOT NULL, + UNIQUE(principal_id, member_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS locks ( - id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, - owner VARCHAR(100), - timeout INTEGER UNSIGNED, - created INTEGER, - token VARCHAR(100), - scope TINYINT, - depth TINYINT, - uri VARCHAR(1000), - INDEX(token), +CREATE TABLE TABLE IF NOT EXISTS locks ( + id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + owner VARCHAR(100), + timeout INTEGER UNSIGNED, + created INTEGER, + token VARCHAR(100), + scope TINYINT, + depth TINYINT, + uri VARCHAR(1000), + INDEX(token), INDEX(uri) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE IF NOT EXISTS calendarobjects ( - id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, - calendardata MEDIUMBLOB, - uri VARCHAR(200), - calendarid INTEGER UNSIGNED NOT NULL, - lastmodified INT(11), - etag VARCHAR(32), - size INT(11) UNSIGNED NOT NULL, - componenttype VARCHAR(8), - firstoccurence INT(11) UNSIGNED, - lastoccurence INT(11) UNSIGNED, - UNIQUE(calendarid, uri) + id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + calendardata MEDIUMBLOB, + uri VARCHAR(200), + calendarid INTEGER UNSIGNED NOT NULL, + lastmodified INT(11) UNSIGNED, + etag VARCHAR(32), + size INT(11) UNSIGNED NOT NULL, + componenttype VARCHAR(8), + firstoccurence INT(11) UNSIGNED, + lastoccurence INT(11) UNSIGNED, + UNIQUE(calendarid, uri) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE IF NOT EXISTS calendars ( - id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, - principaluri VARCHAR(100), - displayname VARCHAR(100), - uri VARCHAR(200), - ctag INTEGER UNSIGNED NOT NULL DEFAULT '0', - description TEXT, - calendarorder INTEGER UNSIGNED NOT NULL DEFAULT '0', - calendarcolor VARCHAR(10), - timezone TEXT, - components VARCHAR(20), - transparent TINYINT(1) NOT NULL DEFAULT '0', - UNIQUE(principaluri, uri) + id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + principaluri VARCHAR(100), + displayname VARCHAR(100), + uri VARCHAR(200), + ctag INTEGER UNSIGNED NOT NULL DEFAULT '0', + description TEXT, + calendarorder INTEGER UNSIGNED NOT NULL DEFAULT '0', + calendarcolor VARCHAR(10), + timezone TEXT, + components VARCHAR(20), + transparent TINYINT(1) NOT NULL DEFAULT '0', + UNIQUE(principaluri, uri) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE IF NOT EXISTS addressbooks ( - id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, - principaluri VARCHAR(255), - displayname VARCHAR(255), - uri VARCHAR(200), - description TEXT, - ctag INT(11) UNSIGNED NOT NULL DEFAULT '1', - UNIQUE(principaluri, uri) + id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + principaluri VARCHAR(255), + displayname VARCHAR(255), + uri VARCHAR(200), + description TEXT, + ctag INT(11) UNSIGNED NOT NULL DEFAULT '1', + UNIQUE(principaluri, uri) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +CREATE TABLE cards ( + id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + addressbookid INT(11) UNSIGNED NOT NULL, + carddata MEDIUMBLOB, + uri VARCHAR(200), + lastmodified INT(11) UNSIGNED ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS cards ( - id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, - addressbookid INT(11) UNSIGNED NOT NULL, - carddata MEDIUMBLOB, - uri VARCHAR(200), - lastmodified INT(11) UNSIGNED -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; \ No newline at end of file diff --git a/Core/Resources/Db/SQLite/db.sql b/Core/Resources/Db/SQLite/db.sql new file mode 100644 index 0000000..ff96ef3 --- /dev/null +++ b/Core/Resources/Db/SQLite/db.sql @@ -0,0 +1,83 @@ +-- +-- This is the empty database schema for Baïkal +-- Corresponds to the MySQL Schema definition of project SabreDAV 1.8.6 +-- http://code.google.com/p/sabredav/ +-- + +CREATE TABLE addressbooks ( + id integer primary key asc, + principaluri text, + displayname text, + uri text, + description text, + ctag integer +); + +CREATE TABLE cards ( + id integer primary key asc, + addressbookid integer, + carddata blob, + uri text, + lastmodified integer +); + +CREATE TABLE calendarobjects ( + id integer primary key asc, + calendardata blob, + uri text, + calendarid integer, + lastmodified integer, + etag text, + size integer, + componenttype text, + firstoccurence integer, + lastoccurence integer +); + +CREATE TABLE calendars ( + id integer primary key asc, + principaluri text, + displayname text, + uri text, + ctag integer, + description text, + calendarorder integer, + calendarcolor text, + timezone text, + components text, + transparent bool +); + +CREATE TABLE locks ( + id integer primary key asc, + owner text, + timeout integer, + created integer, + token text, + scope integer, + depth integer, + uri text +); + +CREATE TABLE principals ( + id INTEGER PRIMARY KEY ASC, + uri TEXT, + email TEXT, + displayname TEXT, + vcardurl TEXT, + UNIQUE(uri) +); + +CREATE TABLE groupmembers ( + id INTEGER PRIMARY KEY ASC, + principal_id INTEGER, + member_id INTEGER, + UNIQUE(principal_id, member_id) +); + +CREATE TABLE users ( + id integer primary key asc, + username TEXT, + digesta1 TEXT, + UNIQUE(username) +); diff --git a/Core/Resources/Db/SQLite/db.sqlite b/Core/Resources/Db/SQLite/db.sqlite index 89a7013e8c18559a2a1e22431f24da3396632929..40daea75d3b65e5aa9fd8f0fe76c24ac430d596a 100644 GIT binary patch delta 200 zcmZoDXegK_mSqlOzRF<4WHwn* zMwZiK~7?2 zUSe)4l4x0SVo^$I5wgO`w`ESTFl94LoY>gQWXwC+M$VW8=tP#y`Eqku896r#vb<-W K7{IznLjV8)r7;iy delta 177 zcmZoDXegKgIFZSieX@m|@#cKFIjozx Lb-r>h(%=99A>l8E