BEGIN;

CREATE TABLE IF NOT EXISTS regions (
    code VARCHAR(3),
    chefLieu VARCHAR(5),
    nom VARCHAR(255),
    typeLiaison VARCHAR(255),
    region_zone VARCHAR(255)
);

COPY regions FROM '/docker-entrypoint-initdb.d/regions.csv' DELIMITER ',' CSV;

ALTER TABLE ONLY regions
    ADD CONSTRAINT regions_pkey PRIMARY KEY (code);

COMMIT;

ANALYZE regions;