
-- @AutoRun
-- drop table tl_sent_email;



CREATE TABLE tl_sent_email (
    object_id numeric(12) NOT NULL ,
    object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
    object_created_date timestamp DEFAULT NOW() NOT NULL
    ,
    subject varchar(200) NOT NULL,
    sent_date timestamp NOT NULL,
    application_status varchar(200) NOT NULL,
    message_content text NOT NULL,
    email_to text NOT NULL,
    job_application_id numeric(12)  NOT NULL
    );



ALTER TABLE tl_sent_email ADD    
    CONSTRAINT pk_tl_sent_email PRIMARY KEY 
    (
        object_id
    ) ;
    
    
    
    CREATE INDEX idx_tl_sent_email_job_application_id 
    ON tl_sent_email (job_application_id);
