-- Table: public.company

-- DROP TABLE IF EXISTS public.company;

CREATE TABLE IF NOT EXISTS public.company
(
    id uuid NOT NULL,
    name character varying(255) COLLATE pg_catalog."default",
    notes text COLLATE pg_catalog."default",
    website character varying(255) COLLATE pg_catalog."default",
    CONSTRAINT company_pkey PRIMARY KEY (id)
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.company
    OWNER to jobuser;

-- Table: public.job_application

-- DROP TABLE IF EXISTS public.job_application;

CREATE TABLE IF NOT EXISTS public.job_application
(
    applied_date date,
    last_updated timestamp(6) with time zone,
    company_id uuid NOT NULL,
    id uuid NOT NULL,
    job_url character varying(255) COLLATE pg_catalog."default",
    location character varying(255) COLLATE pg_catalog."default",
    notes text COLLATE pg_catalog."default",
    role character varying(255) COLLATE pg_catalog."default",
    salary_expectation character varying(255) COLLATE pg_catalog."default",
    source character varying(255) COLLATE pg_catalog."default",
    status character varying(255) COLLATE pg_catalog."default" NOT NULL,
    CONSTRAINT job_application_pkey PRIMARY KEY (id),
    CONSTRAINT fkpk9sxfmuagscxttppfukwd2pq FOREIGN KEY (company_id)
        REFERENCES public.company (id) MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT job_application_status_check CHECK (status::text = ANY (ARRAY['INTERESTED'::character varying, 'APPLIED'::character varying, 'PHONE_SCREEN'::character varying, 'TECH_INTERVIEW'::character varying, 'OFFER'::character varying, 'REJECTED'::character varying, 'WITHDRAWN'::character varying]::text[]))
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.job_application
    OWNER to jobuser;

