How attachment get stored in DB and what all tables and fields? |
Attachment tables
There are two attachment tables: the attachment details table and the attachment data table. Attachment details table The Attachment details table contains information for the properties of Attachment fields. For every Attachment field in the form, a separate table is created to store the attachment value. The Attachment details table is named with a B followed by the unique ID for the form (for example, B3).An attachment details table with one column (C1) is created with every form. For every attachment field added to any attachment pool on the form, three columns are added. Each column is named with C, CO, or CC, followed by the attachment field ID. For example, the three columns added for one attachment might be called C536870920, CO536870920, and CC536870920, where 536870920 is the attachment field ID. The C column stores the full path name of the attached file. The CO column stores the original size (in bytes) of the attached file. The CC column stores the compressed size (in bytes) of the attachment file. Attachment data table For each attachment field on a form, an attachment data table is created. The attachment data table is named with a B followed by the unique ID for the form, followed by C, followed by the attachment field ID. For example, the attachment data table might be called B7C536870920, where 7 is the schemaID, and 536870920 is the attachment field ID. The Attachment data table has two columns: one that holds the Request ID (entryId) and one that holds the data from the file. The column holding the data is named with a C followed by the attachment field ID. For example, the data column might be named C536870920, where 536870920 is the attachment field ID |