X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doc%2Fdatabase%2Fdb_photo.md;h=ed417f61470a7b2e2996c034637ca5fc813488b1;hb=8a7d08ae2860d82fe98a26f4e86626b3c7eb4d1e;hp=2bb7473e214f1d4ad6c3333a476aeef88acf4e67;hpb=29f7ebe307c22b275466390937b82ccb3820fb1c;p=friendica.git diff --git a/doc/database/db_photo.md b/doc/database/db_photo.md index 2bb7473e21..ed417f6147 100644 --- a/doc/database/db_photo.md +++ b/doc/database/db_photo.md @@ -1,29 +1,63 @@ Table photo =========== -| Field | Description | Type | Null | Key | Default | Extra | -| ----------- | ------------------------------------------------------ | ---------------- | ---- | --- | ------------------- | --------------- | -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| uid | user.id of the owner of this data | int(10) unsigned | NO | MUL | 0 | | -| contact-id | contact.id | int(10) unsigned | NO | | 0 | | -| guid | A unique identifier for this photo | varchar(64) | NO | MUL | | | -| resource-id | | varchar(255) | NO | MUL | | | -| created | creation date | datetime | NO | | 0001-01-01 00:00:00 | | -| edited | last edited date | datetime | NO | | 0001-01-01 00:00:00 | | -| title | | varchar(255) | NO | | | | -| desc | | text | NO | | NULL | | -| album | The name of the album to which the photo belongs | varchar(255) | NO | | | | -| filename | | varchar(255) | NO | | | | -| type | image type | varchar(128) | NO | | image/jpeg | | -| height | | smallint(6) | NO | | 0 | | -| width | | smallint(6) | NO | | 0 | | -| size | | int(10) unsigned | NO | | 0 | | -| data | | mediumblob | NO | | NULL | | -| scale | | tinyint(3) | NO | | 0 | | -| profile | | tinyint(1) | NO | | 0 | | -| allow_cid | Access Control - list of allowed contact.id '<19><78>' | mediumtext | NO | | NULL | | -| allow_gid | Access Control - list of allowed groups | mediumtext | NO | | NULL | | -| deny_cid | Access Control - list of denied contact.id | mediumtext | NO | | NULL | | -| deny_gid | Access Control - list of denied groups | mediumtext | NO | | NULL | | +photo storage + +Fields +------ + +| Field | Description | Type | Null | Key | Default | Extra | +| ------------- | ------------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- | +| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment | +| uid | Owner User id | mediumint unsigned | NO | | 0 | | +| contact-id | contact.id | int unsigned | NO | | 0 | | +| guid | A unique identifier for this photo | char(16) | NO | | | | +| resource-id | | char(32) | NO | | | | +| hash | hash value of the photo | char(32) | YES | | NULL | | +| created | creation date | datetime | NO | | 0001-01-01 00:00:00 | | +| edited | last edited date | datetime | NO | | 0001-01-01 00:00:00 | | +| title | | varchar(255) | NO | | | | +| desc | | text | YES | | NULL | | +| album | The name of the album to which the photo belongs | varchar(255) | NO | | | | +| photo-type | User avatar, user banner, contact avatar, contact banner or default | tinyint unsigned | YES | | NULL | | +| filename | | varchar(255) | NO | | | | +| type | | varchar(30) | NO | | image/jpeg | | +| height | | smallint unsigned | NO | | 0 | | +| width | | smallint unsigned | NO | | 0 | | +| datasize | | int unsigned | NO | | 0 | | +| blurhash | BlurHash representation of the photo | varbinary(255) | YES | | NULL | | +| data | | mediumblob | NO | | NULL | | +| scale | | tinyint unsigned | NO | | 0 | | +| profile | | boolean | NO | | 0 | | +| allow_cid | Access Control - list of allowed contact.id '<19><78>' | mediumtext | YES | | NULL | | +| allow_gid | Access Control - list of allowed groups | mediumtext | YES | | NULL | | +| deny_cid | Access Control - list of denied contact.id | mediumtext | YES | | NULL | | +| deny_gid | Access Control - list of denied groups | mediumtext | YES | | NULL | | +| accessible | Make photo publicly accessible, ignoring permissions | boolean | NO | | 0 | | +| backend-class | Storage backend class | tinytext | YES | | NULL | | +| backend-ref | Storage backend data reference | text | YES | | NULL | | +| updated | | datetime | NO | | 0001-01-01 00:00:00 | | + +Indexes +------------ + +| Name | Fields | +| ----------------------------- | ------------------------------------ | +| PRIMARY | id | +| contactid | contact-id | +| uid_contactid | uid, contact-id | +| uid_profile | uid, profile | +| uid_album_scale_created | uid, album(32), scale, created | +| uid_album_resource-id_created | uid, album(32), resource-id, created | +| resource-id | resource-id | +| uid_photo-type | uid, photo-type | + +Foreign Keys +------------ + +| Field | Target Table | Target Field | +|-------|--------------|--------------| +| uid | [user](help/database/db_user) | uid | +| contact-id | [contact](help/database/db_contact) | id | Return to [database documentation](help/database)