
-- @AutoRun
-- drop table tl_chat_attachment;



CREATE TABLE tl_chat_attachment (
    object_id numeric(12) NOT NULL ,
    object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
    object_created_date timestamp DEFAULT NOW() NOT NULL
    ,
    file bytea NULL,
    message_id numeric(12)  NULL
    );



ALTER TABLE tl_chat_attachment ADD    
    CONSTRAINT pk_tl_chat_attachment PRIMARY KEY 
    (
        object_id
    ) ;
    
    
    
    CREATE INDEX idx_tl_chat_attachment_message_id 
    ON tl_chat_attachment (message_id);
