]> git.mxchange.org Git - friendica.git/blob - doc/database/db_photo.md
Handling of special characters
[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 | filename      |                                                        | varchar(255)       | NO   |     |                     |                |
23 | type          |                                                        | varchar(30)        | NO   |     | image/jpeg          |                |
24 | height        |                                                        | smallint unsigned  | NO   |     | 0                   |                |
25 | width         |                                                        | smallint unsigned  | NO   |     | 0                   |                |
26 | datasize      |                                                        | int unsigned       | NO   |     | 0                   |                |
27 | data          |                                                        | mediumblob         | NO   |     | NULL                |                |
28 | scale         |                                                        | tinyint unsigned   | NO   |     | 0                   |                |
29 | profile       |                                                        | boolean            | NO   |     | 0                   |                |
30 | allow_cid     | Access Control - list of allowed contact.id '<19><78>' | mediumtext         | YES  |     | NULL                |                |
31 | allow_gid     | Access Control - list of allowed groups                | mediumtext         | YES  |     | NULL                |                |
32 | deny_cid      | Access Control - list of denied contact.id             | mediumtext         | YES  |     | NULL                |                |
33 | deny_gid      | Access Control - list of denied groups                 | mediumtext         | YES  |     | NULL                |                |
34 | accessible    | Make photo publicly accessible, ignoring permissions   | boolean            | NO   |     | 0                   |                |
35 | backend-class | Storage backend class                                  | tinytext           | YES  |     | NULL                |                |
36 | backend-ref   | Storage backend data reference                         | text               | YES  |     | NULL                |                |
37 | updated       |                                                        | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
38
39 Indexes
40 ------------
41
42 | Name                          | Fields                               |
43 | ----------------------------- | ------------------------------------ |
44 | PRIMARY                       | id                                   |
45 | contactid                     | contact-id                           |
46 | uid_contactid                 | uid, contact-id                      |
47 | uid_profile                   | uid, profile                         |
48 | uid_album_scale_created       | uid, album(32), scale, created       |
49 | uid_album_resource-id_created | uid, album(32), resource-id, created |
50 | resource-id                   | resource-id                          |
51
52 Foreign Keys
53 ------------
54
55 | Field | Target Table | Target Field |
56 |-------|--------------|--------------|
57 | uid | [user](help/database/db_user) | uid |
58 | contact-id | [contact](help/database/db_contact) | id |
59
60 Return to [database documentation](help/database)