The attachments table contains the details of all attachments (images or files) associated with raised issues.
Table 7.3. Attachments table description
Column Name |
Type |
Size |
Not Null? |
Constraints |
Description |
---|---|---|---|---|---|
id |
Number |
n/a |
Yes |
primary key |
A unique numeric ID that identifies an attachment. Populated by an auto sequence. |
article_id |
Varchar |
10 |
Yes |
Foreign key to associated issue. |
Associated kbase article. |
uid |
Int |
11 |
No |
None |
User id of the user attaching the file. |
title |
Varchar |
255 |
Yes |
None |
Title for attachment. |
description |
Mediumtext |
- |
Yes |
None |
Description of the file attachment. |
filepath |
Mediumtext |
1024 |
Yes |
None |
Path to the file in the system. |
filename |
Varchar |
255 |
No |
None |
Original name of the file attachment. |
hashname |
text |
- |
No |
None |
Hash of file name and date string. |
filetype |
Varchar |
255 |
No |
None |
Type of file attachment. Default `application/octet-stream` |
size |
Integer |
10 |
Yes |
None |
Size of file attachment. |
state |
Number |
4 |
No |
None |
Indicates issue is visible in front end. |
ordering |
Number |
11 |
No |
None |
Specifies ordering of issues. |
checked_out |
Number |
11 |
Yes |
None |
Joomla field record locking |
checked_out_time |
Date |
n/a |
Yes |
None |
Joomla field record locking |
created_on |
Date |
n/a |
Yes |
None |
Date the record was created. |
created_by |
Varchar |
255 |
Yes |
None |
The user who created the record. |
modified_on |
Date |
n/a |
Yes |
None |
The date the record was last modified. |
modified_by |
Varchar |
255 |
Yes |
None |
The user who last modified the record. |
The design of using a separate table to store details of attachments has a few pros and cons associated. The pros include the minimising of the amount of information stored about attachments as opposed to storing the information within the article table directly. One of the downsides is that it is necessary to have details of the item to which the attachment is connected. This means that articles have to exist as records within the database prior to the attachments being made.
Our experience seems to indicate that attachments are not the norm with Joomla components and tend to be very few, hence saving database space by saving the details separately is very beneficial.