
-- DROP TABLE tl_assessment_template;




CREATE TABLE tl_assessment_template (
    object_id number(12) NOT NULL ,
    object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
    object_created_date date DEFAULT SYSDATE NOT NULL
    ,
    template_name varchar2(100) NULL,
    job_title varchar2(60) NOT NULL,
    job_description clob NOT NULL,
    ref_number varchar2(10) NULL,
    google_address_text varchar2(300) NOT NULL,
    location_radius varchar2(200) NOT NULL,
    remote char(1) NULL,
    job_type varchar2(200) NOT NULL,
    industry varchar2(200) NOT NULL,
    require_cv char(1) NULL,
    assessment_type varchar2(200) NOT NULL,
    include_assessment_criteria char(1) NOT NULL,
    level_id number(12)  NULL,
    occupation_id number(12)  NOT NULL,
    job_owner_id number(12)  NULL,
    job_id number(12)  NULL,
    client_id number(12)  NULL,
    hiring_team_id number(12)  NULL,
    company_user_id number(12)  NULL,
    job_title_id number(12)  NOT NULL
    );



ALTER TABLE tl_assessment_template ADD    
    CONSTRAINT PK_tl_assessment_template PRIMARY KEY 
    (
        object_id
    ) ;
    
    
    
        CREATE UNIQUE INDEX idx_tl_assessment_template_TemplateID ON 
        tl_assessment_template (template_name, hiring_team_id, company_user_id);
    