
-- @AutoRun
-- drop table tl_job;



CREATE TABLE tl_job (
    object_id numeric(12) NOT NULL ,
    object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
    object_created_date timestamp DEFAULT NOW() NOT NULL
    ,
    job_title varchar(30) NOT NULL,
    job_description text NOT NULL,
    job_status varchar(200) NOT NULL,
    open_date timestamp NULL,
    apply_by timestamp NULL,
    include_assessment_criteria char(1) NOT NULL,
    assessment_type varchar(200) NOT NULL,
    random_key varchar(10) NULL,
    job_type varchar(200) NOT NULL,
    ref_number varchar(10) NULL,
    last_status_change_date timestamp NULL,
    remote char(1) NULL,
    city varchar(100) NULL,
    postcode varchar(100) NULL,
    location_radius varchar(200) NOT NULL,
    state varchar(200) NULL,
    country varchar(200) NULL,
    require_cv char(1) NULL,
    manually_closed char(1) NULL,
    last_edited timestamp NULL,
    is_ppj char(1) NULL,
    industry varchar(200) NOT NULL,
    culture_statement varchar(2000) NULL,
    draft_location varchar(200) NULL,
    google_address_text varchar(300) NOT NULL,
    level_id numeric(12)  NULL,
    client_id numeric(12)  NULL,
    job_owner_id numeric(12)  NULL,
    company_user_id numeric(12)  NULL,
    hiring_team_id numeric(12)  NULL,
    occupation_id numeric(12)  NOT NULL,
    shortened_url_id numeric(12)  NULL,
    template_id numeric(12)  NULL,
    job_title_id numeric(12)  NOT NULL
    );



ALTER TABLE tl_job ADD    
    CONSTRAINT pk_tl_job PRIMARY KEY 
    (
        object_id
    ) ;
    
    
    
    CREATE INDEX idx_tl_job_client_id 
    ON tl_job (client_id);
