attachment

Table info.

Title Attachment
Description Attachment

Fields

Name Type Required Index Hidden On form Title Pick list Description
AttachmentID int(11) PRI
TimestampCreated datetime Created The date the attachment record was created
TimestampModified datetime Last edited The date the attachment record was last edited
Version int(11) Version version
AttachmentLocation varchar(128) Attachment Location Location of attachment repository.
CopyrightDate varchar(64) Copyright date The date that copyright in the image was asserted. Copyright date will default to the year in the Image creation date if left blank.
CopyrightHolder varchar(64) Copyright holder The person or organisation who owns copyright in an image. The Copyright holder will default to the photographer (in the Image attributes table), if left blank. For staff (at the time the image was taken), copyright should be RBG Victoria.
Credit varchar(64) Attribution How the image should be attributed. If Attribution is left blank, it will default to Photographer.
DateImaged varchar(64) MUL Image creation date The date the image was created (this is filled in automatically from the EXIF data)
FileCreatedDate date File Created Date fileCreatedDate
License varchar(64) Restrictions on use Any restrictions on use of the image instructed by the copyright holder or photographer. If a Licence has been provided but no restrictions on use entered, we will assume that we can use the image for any purpose that fits the licence terms.
MimeType varchar(64) MIME type Describes the attachment file type
origFilename varchar(20000) Original file name The original file name of the attachment. The Original file name will be automatically taken from the file being uploaded.
Remarks text Subject The subject of the attachment, e.g. 'Part of inflorescence', 'Testa surface', 'Letter from McHard to Mueller, dated 1885'. There is no need to repeat information that is elsewhere in the record, such as Catalogue number, Taxon name or Collector.
title varchar(255) MUL Title The title of the attachment (the Original file name without the file path). The title will be automatically filled in from the Original file name; the Title does not have to be meaningful.
TableID smallint(6) Table I D tableID
ScopeID int(11) MUL Scope I D scopeID
ScopeType tinyint(4) MUL Scope Type scopeType
GUID varchar(128) MUL GUID guid
Visibility tinyint(4) Visibility visibility
AttachmentImageAttributeID int(11) MUL
CreatedByAgentID int(11) MUL
ModifiedByAgentID int(11) MUL
VisibilitySetByID int(11) MUL
IsPublic bit(1) Is Public isPublic
CreatorID int(11) MUL
CaptureDevice varchar(128) Capture Device captureDevice
LicenseLogoUrl varchar(256) License Logo Url licenseLogoUrl
MetadataText varchar(256) Metadata Text metadataText
SubjectOrientation varchar(64) Subject Orientation subjectOrientation
Subtype varchar(64) Subtype subtype
Type varchar(64) Type type
AttachmentStorageConfig text Attachment Storage Config attachmentStorageConfig

Indexes

Name Fields Unique Nullable
AttchmentGuidIDX GUID
AttchScopeIDIDX ScopeID
AttchScopeTypeIDX ScopeType
DateImagedIDX DateImaged
FK8AF759235327F942 ModifiedByAgentID
FK8AF759237699B003 CreatedByAgentID
FK8AF759237BF1F70B VisibilitySetByID
FK8AF759239B37C589 CreatorID
FK8AF75923C620DBC6 AttachmentImageAttributeID
PRIMARY AttachmentID
TitleIDX title

One-to-many relationships

Name Field Related table Related field
FKA569B447C7E55084 AttachmentID accessionattachment AttachmentID
FK56FE59E8C7E55084 AttachmentID agentattachment AttachmentID
FK99170152C7E55084 AttachmentID attachmentmetadata AttachmentID
FKA62FAF97C7E55084 AttachmentID attachmenttag AttachmentID
FK32C365C5C7E55084 AttachmentID collectingeventattachment AttachmentID
FK3E419F80C7E55084 AttachmentID collectingtripattachment AttachmentID
FK9C00EC40C7E55084 AttachmentID collectionobjectattachment AttachmentID
FK1EED2087C7E55084 AttachmentID conservdescriptionattachment AttachmentID
FKD3F7CFA5C7E55084 AttachmentID conserveventattachment AttachmentID
FKFFC2E0FBC7E55084 AttachmentID dnasequenceattachment AttachmentID
FKD0DAEB16C7E55084 AttachmentID dnasequencerunattachment AttachmentID
FKDC15BBB8C7E55084 AttachmentID fieldnotebookattachment AttachmentID
FK91AA2507C7E55084 AttachmentID fieldnotebookpageattachment AttachmentID
FKB1477CA1C7E55084 AttachmentID fieldnotebookpagesetattachment AttachmentID
FK23ECB213C7E55084 AttachmentID loanattachment AttachmentID
FKB39C36C6C7E55084 AttachmentID localityattachment AttachmentID
FK7064B77EC7E55084 AttachmentID permitattachment AttachmentID
FKE3FD6EFAC7E55084 AttachmentID preparationattachment AttachmentID
FK9366323C7E55084 AttachmentID repositoryagreementattachment AttachmentID
FKBE9EFDDEC7E55084 AttachmentID storageattachment AttachmentID
FKF523736DC7E55084 AttachmentID taxonattachment AttachmentID
FK1725BC5C7E55084 AttachmentID treatmenteventattachment AttachmentID

Many-to-one relationships

Name Field Related table Related field
FK8AF759235327F942 ModifiedByAgentID agent AgentID
FK8AF759237699B003 CreatedByAgentID agent AgentID
FK8AF759237BF1F70B VisibilitySetByID specifyuser SpecifyUserID
FK8AF759239B37C589 CreatorID agent AgentID
FK8AF75923C620DBC6 AttachmentImageAttributeID attachmentimageattribute AttachmentImageAttributeID

attachment_before_insert

EventINSERT
TimingBEFORE
Statement:
DROP TRIGGER IF EXISTS attachment_before_insert;
 
DELIMITER $$
 
CREATE TRIGGER attachment_before_insert BEFORE INSERT ON attachment
FOR EACH ROW
  BEGIN
    IF isnull(@DISABLE_TRIGGER) THEN
      SET NEW.Title = SUBSTRING_INDEX(NEW.origFilename, '\', -1);
    END IF;
  END
 
DELIMITER ;