
-- DROP TABLE tl_message;



CREATE TABLE tl_message (
    object_id int NOT NULL ,
    object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
    object_created_date datetime DEFAULT getdate() 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);
