
-- @AutoRun
-- drop table tl_attachment;



CREATE TABLE tl_attachment (
    object_id numeric(12) NOT NULL ,
    object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
    object_created_date timestamp DEFAULT NOW() NOT NULL
    ,
    attachment_name varchar(100) NULL,
    attachment_file bytea NULL,
    email_message_id numeric(12)  NULL
    );



ALTER TABLE tl_attachment ADD    
    CONSTRAINT pk_tl_attachment PRIMARY KEY 
    (
        object_id
    ) ;
    
    
    
    CREATE INDEX idx_tl_attachment_email_message_id 
    ON tl_attachment (email_message_id);
