CREATE TABLE IF NOT EXISTS teleinfo (
    created TIMESTAMP WITH TIME ZONE DEFAULT now(),
    adco CHARACTER VARYING(12) NOT NULL,
    optarif CHARACTER VARYING(4) NOT NULL,
    isousc SMALLINT DEFAULT 0 NOT NULL,
    hchp BIGINT DEFAULT 0 NOT NULL,
    hchc BIGINT DEFAULT 0 NOT NULL,
    ptec CHARACTER VARYING(4) NOT NULL,
    iinst INTEGER DEFAULT 0 NOT NULL,
    imax INTEGER DEFAULT 0 NOT NULL,
    papp INTEGER DEFAULT 0 NOT NULL,
    hhphc CHARACTER VARYING(1) NOT NULL,
    motdetat CHARACTER VARYING(6) NOT NULL
);

CREATE INDEX IF NOT EXISTS teleinfo_created_index ON teleinfo (created DESC);
