Skip to content

Commit

Permalink
Merge remote-tracking branch 'cp/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
fmbiete committed Aug 28, 2014
2 parents 2f87f6c + 27571d8 commit 7c41a8e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ Contact
* Author: Christian Putzke <[email protected]>
* Report feature requests and bugs here: https://github.com/graviox/Roundcube-CardDAV/issues
* Visit Graviox Studios: http://www.graviox.de/
* Follow me on Twitter: https://twitter.com/graviox/
* Follow me on Twitter: https://twitter.com/graviox/
35 changes: 35 additions & 0 deletions SQL/sqlite.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
CREATE TABLE carddav_contacts (
carddav_contact_id integer NOT NULL PRIMARY KEY,
carddav_server_id integer NOT NULL,
user_id integer NOT NULL,
etag VARCHAR(64) NOT NULL,
last_modified VARCHAR(128) NOT NULL,
vcard_id VARCHAR(64) NOT NULL,
vcard TEXT NOT NULL,
words TEXT NOT NULL,
firstname varchar(128) DEFAULT NULL,
surname varchar(128) DEFAULT NULL,
name varchar(255) DEFAULT NULL,
email varchar(255) DEFAULT NULL,

UNIQUE(carddav_server_id,user_id,vcard_id),
-- not enforced by sqlite < 3.6.19
FOREIGN KEY(carddav_server_id) REFERENCES carddav_server(carddav_server_id) ON DELETE CASCADE
);

CREATE TABLE carddav_server (
carddav_server_id integer NOT NULL PRIMARY KEY,
user_id integer NOT NULL,
url varchar(255) NOT NULL,
username VARCHAR(128) NOT NULL,
password VARCHAR(128) NOT NULL,
label VARCHAR(128) NOT NULL,
read_only TINYINT NOT NULL,

-- not enforced by sqlite < 3.6.19
FOREIGN KEY(user_id) REFERENCES users(user_id) ON DELETE CASCADE
);

CREATE INDEX userid_dav_idx1 ON carddav_contacts(user_id);
CREATE INDEX userid_dav_idx2 ON carddav_server(user_id);

0 comments on commit 7c41a8e

Please sign in to comment.