]> git.mxchange.org Git - friendica.git/blob - doc/database/db_photo.md
Support Blurhash
[friendica.git] / doc / database / db_photo.md
1 Table photo
2 ===========
3
4 photo storage
5
6 Fields
7 ------
8
9 | Field         | Description                                                         | Type               | Null | Key | Default             | Extra          |
10 | ------------- | ------------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
11 | id            | sequential ID                                                       | int unsigned       | NO   | PRI | NULL                | auto_increment |
12 | uid           | Owner User id                                                       | mediumint unsigned | NO   |     | 0                   |                |
13 | contact-id    | contact.id                                                          | int unsigned       | NO   |     | 0                   |                |
14 | guid          | A unique identifier for this photo                                  | char(16)           | NO   |     |                     |                |
15 | resource-id   |                                                                     | char(32)           | NO   |     |                     |                |
16 | hash          | hash value of the photo                                             | char(32)           | YES  |     | NULL                |                |
17 | created       | creation date                                                       | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
18 | edited        | last edited date                                                    | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
19 | title         |                                                                     | varchar(255)       | NO   |     |                     |                |
20 | desc          |                                                                     | text               | YES  |     | NULL                |                |
21 | album         | The name of the album to which the photo belongs                    | varchar(255)       | NO   |     |                     |                |
22 | photo-type    | User avatar, user banner, contact avatar, contact banner or default | tinyint unsigned   | YES  |     | NULL                |                |
23 | filename      |                                                                     | varchar(255)       | NO   |     |                     |                |
24 | type          |                                                                     | varchar(30)        | NO   |     | image/jpeg          |                |
25 | height        |                                                                     | smallint unsigned  | NO   |     | 0                   |                |
26 | width         |                                                                     | smallint unsigned  | NO   |     | 0                   |                |
27 | datasize      |                                                                     | int unsigned       | NO   |     | 0                   |                |
28 | blurhash      | BlurHash representation of the photo                                | varbinary(255)     | YES  |     | NULL                |                |
29 | data          |                                                                     | mediumblob         | NO   |     | NULL                |                |
30 | scale         |                                                                     | tinyint unsigned   | NO   |     | 0                   |                |
31 | profile       |                                                                     | boolean            | NO   |     | 0                   |                |
32 | allow_cid     | Access Control - list of allowed contact.id '<19><78>'              | mediumtext         | YES  |     | NULL                |                |
33 | allow_gid     | Access Control - list of allowed groups                             | mediumtext         | YES  |     | NULL                |                |
34 | deny_cid      | Access Control - list of denied contact.id                          | mediumtext         | YES  |     | NULL                |                |
35 | deny_gid      | Access Control - list of denied groups                              | mediumtext         | YES  |     | NULL                |                |
36 | accessible    | Make photo publicly accessible, ignoring permissions                | boolean            | NO   |     | 0                   |                |
37 | backend-class | Storage backend class                                               | tinytext           | YES  |     | NULL                |                |
38 | backend-ref   | Storage backend data reference                                      | text               | YES  |     | NULL                |                |
39 | updated       |                                                                     | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
40
41 Indexes
42 ------------
43
44 | Name                          | Fields                               |
45 | ----------------------------- | ------------------------------------ |
46 | PRIMARY                       | id                                   |
47 | contactid                     | contact-id                           |
48 | uid_contactid                 | uid, contact-id                      |
49 | uid_profile                   | uid, profile                         |
50 | uid_album_scale_created       | uid, album(32), scale, created       |
51 | uid_album_resource-id_created | uid, album(32), resource-id, created |
52 | resource-id                   | resource-id                          |
53 | uid_photo-type                | uid, photo-type                      |
54
55 Foreign Keys
56 ------------
57
58 | Field | Target Table | Target Field |
59 |-------|--------------|--------------|
60 | uid | [user](help/database/db_user) | uid |
61 | contact-id | [contact](help/database/db_contact) | id |
62
63 Return to [database documentation](help/database)