| 1 | CREATE TABLE IF NOT EXISTS profile_partnersharing_enum ( |
| 2 | id int(6) unsigned NOT NULL, |
| 3 | api_uid int(11) unsigned NULL, |
| 4 | shortname varchar(64) NOT NULL DEFAULT '', |
| 5 | name varchar(255) NOT NULL DEFAULT '', |
| 6 | url varchar(255) NOT NULL DEFAULT '', |
| 7 | default_sharing_level enum('admin', 'private', 'ax', 'public', 'none') DEFAULT 'none', |
| 8 | has_directory int(1) unsigned NOT NULL DEFAULT 0, |
| 9 | has_bulkmail int(1) unsigned NOT NULL DEFAULT 0, |
| 10 | PRIMARY KEY (id), |
| 11 | FOREIGN KEY (api_uid) REFERENCES accounts (uid) ON DELETE SET NULL ON UPDATE CASCADE |
| 12 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 13 | |
| 14 | INSERT INTO profile_partnersharing_enum |
| 15 | SET shortname = 'pta', name = 'ParisTech Alumni', url = 'http://www.paristech-alumni.org', default_sharing_level = 'public', has_directory = 1, has_bulkmail = 1; |
| 16 | |
| 17 | CREATE TABLE IF NOT EXISTS profile_partnersharing_settings ( |
| 18 | pid int(11) unsigned NOT NULL, |
| 19 | partner_id int(6) unsigned NOT NULL, |
| 20 | exposed_uid varchar(255) NOT NULL, |
| 21 | sharing_level enum('admin', 'private', 'ax', 'public', 'none') DEFAULT 'none', |
| 22 | allow_email enum('none', 'digest', 'direct') DEFAULT 'direct', |
| 23 | last_connection datetime NULL, |
| 24 | PRIMARY KEY (pid, partner_id), |
| 25 | KEY (partner_id, exposed_uid), |
| 26 | FOREIGN KEY (pid) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE, |
| 27 | FOREIGN KEY (partner_id) REFERENCES profile_partnersharing_enum (id) ON DELETE CASCADE ON UPDATE CASCADE |
| 28 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 29 | |
| 30 | CREATE TABLE IF NOT EXISTS profile_photo_tokens ( |
| 31 | pid int(11) unsigned NOT NULL, |
| 32 | token varchar(255) NOT NULL, |
| 33 | expires datetime NOT NULL, |
| 34 | PRIMARY KEY (pid), |
| 35 | KEY (token), |
| 36 | FOREIGN KEY (pid) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE |
| 37 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |