
-- @AutoRun
-- drop table tl_message;



CREATE TABLE tl_message (
    object_id numeric(12) NOT NULL ,
    object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
    object_created_date timestamp DEFAULT NOW() NOT NULL
    ,
    sent_via varchar(200) NULL,
    message_content text NULL,
    is_read char(1) NULL,
    sent_by numeric(12)  NULL,
    work_flow_message numeric(12)  NULL,
    job_application_id numeric(12)  NOT NULL
    );



ALTER TABLE tl_message ADD    
    CONSTRAINT pk_tl_message PRIMARY KEY 
    (
        object_id
    ) ;
    
    
    
    CREATE INDEX idx_tl_message_job_application_id 
    ON tl_message (job_application_id);
