
-- DROP TABLE tl_job;



CREATE TABLE tl_job (
    object_id int NOT NULL ,
    object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
    object_created_date datetime DEFAULT getdate() NOT NULL
    ,
    job_title varchar(500) NOT NULL,
    job_description text NOT NULL,
    job_status varchar(200) NOT NULL,
    open_date datetime NULL,
    apply_by datetime 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(100) NULL,
    last_status_change_date datetime NULL,
    remote char(1) NULL,
    city varchar(100) NULL,
    state varchar(200) NULL,
    country varchar(200) NULL,
    manually_closed char(1) NULL,
    level_id numeric(12)  NULL,
    client_id numeric(12)  NULL,
    company_user_id numeric(12)  NULL,
    shortened_url_id numeric(12)  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);
