diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2014-06-24 19:34:36 +0200 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2014-06-24 19:34:36 +0200 |
commit | b8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70 (patch) | |
tree | 718df6305bcb82c8dcb4b287a7132422e748cdfb /vendor/sabre/dav/examples/sql | |
parent | c2d520f1be115fb3cb5da2a35eb10146cecee8aa (diff) | |
parent | a92fb0b04c3e6474ec48faf8e4cc65c382e89d66 (diff) | |
download | volse-hubzilla-b8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70.tar.gz volse-hubzilla-b8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70.tar.bz2 volse-hubzilla-b8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'vendor/sabre/dav/examples/sql')
-rw-r--r-- | vendor/sabre/dav/examples/sql/mysql.addressbook.sql | 18 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/mysql.calendars.sql | 28 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/mysql.locks.sql | 13 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/mysql.principals.sql | 22 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/mysql.users.sql | 9 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/pgsql.addressbook.sql | 33 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/pgsql.calendars.sql | 42 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/pgsql.locks.sql | 13 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/pgsql.principals.sql | 40 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/pgsql.users.sql | 15 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql | 17 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/sqlite.calendars.sql | 26 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/sqlite.locks.sql | 12 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/sqlite.principals.sql | 21 | ||||
-rw-r--r-- | vendor/sabre/dav/examples/sql/sqlite.users.sql | 9 |
15 files changed, 318 insertions, 0 deletions
diff --git a/vendor/sabre/dav/examples/sql/mysql.addressbook.sql b/vendor/sabre/dav/examples/sql/mysql.addressbook.sql new file mode 100644 index 000000000..f603ad4c5 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/mysql.addressbook.sql @@ -0,0 +1,18 @@ +CREATE TABLE 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) +) 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; + diff --git a/vendor/sabre/dav/examples/sql/mysql.calendars.sql b/vendor/sabre/dav/examples/sql/mysql.calendars.sql new file mode 100644 index 000000000..a8eb102d1 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/mysql.calendars.sql @@ -0,0 +1,28 @@ +CREATE TABLE calendarobjects ( + 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 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) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/vendor/sabre/dav/examples/sql/mysql.locks.sql b/vendor/sabre/dav/examples/sql/mysql.locks.sql new file mode 100644 index 000000000..cf3caf4f7 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/mysql.locks.sql @@ -0,0 +1,13 @@ +CREATE TABLE 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) +); + diff --git a/vendor/sabre/dav/examples/sql/mysql.principals.sql b/vendor/sabre/dav/examples/sql/mysql.principals.sql new file mode 100644 index 000000000..da9282818 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/mysql.principals.sql @@ -0,0 +1,22 @@ +CREATE TABLE principals ( + 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) +); + +CREATE TABLE 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) +); + + +INSERT INTO principals (uri,email,displayname) VALUES +('principals/admin', 'admin@example.org','Administrator'), +('principals/admin/calendar-proxy-read', null, null), +('principals/admin/calendar-proxy-write', null, null); + diff --git a/vendor/sabre/dav/examples/sql/mysql.users.sql b/vendor/sabre/dav/examples/sql/mysql.users.sql new file mode 100644 index 000000000..1244f596f --- /dev/null +++ b/vendor/sabre/dav/examples/sql/mysql.users.sql @@ -0,0 +1,9 @@ +CREATE TABLE users ( + id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + username VARCHAR(50), + digesta1 VARCHAR(32), + UNIQUE(username) +); + +INSERT INTO users (username,digesta1) VALUES +('admin', '87fd274b7b6c01e48d7c2f965da8ddf7'); diff --git a/vendor/sabre/dav/examples/sql/pgsql.addressbook.sql b/vendor/sabre/dav/examples/sql/pgsql.addressbook.sql new file mode 100644 index 000000000..c3ca8b291 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/pgsql.addressbook.sql @@ -0,0 +1,33 @@ +CREATE TABLE addressbooks ( + id SERIAL NOT NULL, + principaluri VARCHAR(255), + displayname VARCHAR(255), + uri VARCHAR(200), + description TEXT, + ctag INTEGER NOT NULL DEFAULT 1 +); + +ALTER TABLE ONLY addressbooks + ADD CONSTRAINT addressbooks_pkey PRIMARY KEY (id); + +CREATE UNIQUE INDEX addressbooks_ukey + ON addressbooks USING btree (principaluri, uri); + +CREATE TABLE cards ( + id SERIAL NOT NULL, + addressbookid INTEGER NOT NULL, + carddata TEXT, + uri VARCHAR(200), + lastmodified INTEGER +); + +ALTER TABLE ONLY cards + ADD CONSTRAINT cards_pkey PRIMARY KEY (id); + +CREATE UNIQUE INDEX cards_ukey + ON cards USING btree (addressbookid, uri); + +ALTER TABLE ONLY cards + ADD CONSTRAINT cards_addressbookid_fkey FOREIGN KEY (addressbookid) REFERENCES addressbooks(id) + ON DELETE CASCADE; + diff --git a/vendor/sabre/dav/examples/sql/pgsql.calendars.sql b/vendor/sabre/dav/examples/sql/pgsql.calendars.sql new file mode 100644 index 000000000..23465ae93 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/pgsql.calendars.sql @@ -0,0 +1,42 @@ +CREATE TABLE calendars ( + id SERIAL NOT NULL, + principaluri VARCHAR(100), + displayname VARCHAR(100), + uri VARCHAR(200), + ctag INTEGER NOT NULL DEFAULT 0, + description TEXT, + calendarorder INTEGER NOT NULL DEFAULT 0, + calendarcolor VARCHAR(10), + timezone TEXT, + components VARCHAR(20), + transparent SMALLINT NOT NULL DEFAULT '0' +); + +ALTER TABLE ONLY calendars + ADD CONSTRAINT calendars_pkey PRIMARY KEY (id); + +CREATE UNIQUE INDEX calendars_ukey + ON calendars USING btree (principaluri, uri); + +CREATE TABLE calendarobjects ( + id SERIAL NOT NULL, + calendarid INTEGER NOT NULL, + calendardata TEXT, + uri VARCHAR(200), + etag VARCHAR(32), + size INTEGER NOT NULL, + componenttype VARCHAR(8), + lastmodified INTEGER, + firstoccurence INTEGER, + lastoccurence INTEGER +); + +ALTER TABLE ONLY calendarobjects + ADD CONSTRAINT calendarobjects_pkey PRIMARY KEY (id); + +CREATE UNIQUE INDEX calendarobjects_ukey + ON calendarobjects USING btree (calendarid, uri); + +ALTER TABLE ONLY calendarobjects + ADD CONSTRAINT calendarobjects_calendarid_fkey FOREIGN KEY (calendarid) REFERENCES calendars(id) + ON DELETE CASCADE; diff --git a/vendor/sabre/dav/examples/sql/pgsql.locks.sql b/vendor/sabre/dav/examples/sql/pgsql.locks.sql new file mode 100644 index 000000000..ca6c82e96 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/pgsql.locks.sql @@ -0,0 +1,13 @@ +CREATE TABLE locks ( + id SERIAL NOT NULL, + owner VARCHAR(100), + timeout INTEGER, + created INTEGER, + token VARCHAR(100), + scope smallint, + depth smallint, + uri text +); + +ALTER TABLE ONLY locks + ADD CONSTRAINT locks_pkey PRIMARY KEY (id); diff --git a/vendor/sabre/dav/examples/sql/pgsql.principals.sql b/vendor/sabre/dav/examples/sql/pgsql.principals.sql new file mode 100644 index 000000000..4afe51063 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/pgsql.principals.sql @@ -0,0 +1,40 @@ +CREATE TABLE principals ( + id SERIAL NOT NULL, + uri VARCHAR(100) NOT NULL, + email VARCHAR(80), + displayname VARCHAR(80), + vcardurl VARCHAR(255) +); + +ALTER TABLE ONLY principals + ADD CONSTRAINT principals_pkey PRIMARY KEY (id); + +CREATE UNIQUE INDEX principals_ukey + ON principals USING btree (uri); + +CREATE TABLE groupmembers ( + id SERIAL NOT NULL, + principal_id INTEGER NOT NULL, + member_id INTEGER NOT NULL +); + +ALTER TABLE ONLY groupmembers + ADD CONSTRAINT groupmembers_pkey PRIMARY KEY (id); + +CREATE UNIQUE INDEX groupmembers_ukey + ON groupmembers USING btree (principal_id, member_id); + +ALTER TABLE ONLY groupmembers + ADD CONSTRAINT groupmembers_principal_id_fkey FOREIGN KEY (principal_id) REFERENCES principals(id) + ON DELETE CASCADE; + +-- Is this correct correct link ... or not? +-- ALTER TABLE ONLY groupmembers +-- ADD CONSTRAINT groupmembers_member_id_id_fkey FOREIGN KEY (member_id) REFERENCES users(id) +-- ON DELETE CASCADE; + +INSERT INTO principals (uri,email,displayname) VALUES +('principals/admin', 'admin@example.org','Administrator'), +('principals/admin/calendar-proxy-read', null, null), +('principals/admin/calendar-proxy-write', null, null); + diff --git a/vendor/sabre/dav/examples/sql/pgsql.users.sql b/vendor/sabre/dav/examples/sql/pgsql.users.sql new file mode 100644 index 000000000..939c931d8 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/pgsql.users.sql @@ -0,0 +1,15 @@ +CREATE TABLE users ( + id SERIAL NOT NULL, + username VARCHAR(50), + digesta1 VARCHAR(32), + UNIQUE(username) +); + +ALTER TABLE ONLY users + ADD CONSTRAINT users_pkey PRIMARY KEY (id); + +CREATE UNIQUE INDEX users_ukey + ON users USING btree (username); + +INSERT INTO users (username,digesta1) VALUES +('admin', '87fd274b7b6c01e48d7c2f965da8ddf7'); diff --git a/vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql b/vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql new file mode 100644 index 000000000..aa7639c5f --- /dev/null +++ b/vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql @@ -0,0 +1,17 @@ +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 +); + diff --git a/vendor/sabre/dav/examples/sql/sqlite.calendars.sql b/vendor/sabre/dav/examples/sql/sqlite.calendars.sql new file mode 100644 index 000000000..537789906 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/sqlite.calendars.sql @@ -0,0 +1,26 @@ +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 +); diff --git a/vendor/sabre/dav/examples/sql/sqlite.locks.sql b/vendor/sabre/dav/examples/sql/sqlite.locks.sql new file mode 100644 index 000000000..fd89b41eb --- /dev/null +++ b/vendor/sabre/dav/examples/sql/sqlite.locks.sql @@ -0,0 +1,12 @@ +BEGIN TRANSACTION; +CREATE TABLE locks ( + id integer primary key asc, + owner text, + timeout integer, + created integer, + token text, + scope integer, + depth integer, + uri text +); +COMMIT; diff --git a/vendor/sabre/dav/examples/sql/sqlite.principals.sql b/vendor/sabre/dav/examples/sql/sqlite.principals.sql new file mode 100644 index 000000000..09dbc4d24 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/sqlite.principals.sql @@ -0,0 +1,21 @@ +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) +); + + +INSERT INTO principals (uri,email,displayname) VALUES ('principals/admin', 'admin@example.org','Administrator'); +INSERT INTO principals (uri,email,displayname) VALUES ('principals/admin/calendar-proxy-read', null, null); +INSERT INTO principals (uri,email,displayname) VALUES ('principals/admin/calendar-proxy-write', null, null); + diff --git a/vendor/sabre/dav/examples/sql/sqlite.users.sql b/vendor/sabre/dav/examples/sql/sqlite.users.sql new file mode 100644 index 000000000..f4b2c1674 --- /dev/null +++ b/vendor/sabre/dav/examples/sql/sqlite.users.sql @@ -0,0 +1,9 @@ +CREATE TABLE users ( + id integer primary key asc, + username TEXT, + digesta1 TEXT, + UNIQUE(username) +); + +INSERT INTO users (username,digesta1) VALUES +('admin', '87fd274b7b6c01e48d7c2f965da8ddf7'); |