
-- @AutoRun
-- drop table tl_message_template;



CREATE TABLE tl_message_template (
    object_id numeric(12) NOT NULL ,
    object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
    object_created_date timestamp DEFAULT NOW() NOT NULL
    ,
    message_id numeric(12) NULL,
    template_name varchar(200) NOT NULL,
    subject varchar(200) NOT NULL,
    application_status varchar(200) NULL,
    delay_hrs numeric(12) NULL,
    delay_min numeric(12) NULL,
    variance numeric(12) NULL,
    business_hours_only char(1) NULL,
    message_content text NOT NULL,
    template_type varchar(200) NOT NULL,
    is_global_template char(1) NULL,
    is_system_generated char(1) NULL,
    hiring_team_id numeric(12)  NULL
    );



ALTER TABLE tl_message_template ADD    
    CONSTRAINT pk_tl_message_template PRIMARY KEY 
    (
        object_id
    ) ;
    
    
    
    CREATE INDEX idx_tl_message_template_hiring_team_id 
    ON tl_message_template (hiring_team_id);
