DROP TABLE IF EXISTS communes;

CREATE TABLE communes (
    ogc_fid integer NOT NULL,
    nom character varying,
    nomreduit character varying,
    insee character varying,
    datecreation timestamp with time zone,
    datemajalpha timestamp with time zone,
    trigramme character varying,
    libofficiel character varying,
    gid integer,
    wkb_geometry geometry(Polygon,4326)
);


CREATE SEQUENCE communes_ogc_fid_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE communes_ogc_fid_seq OWNED BY communes.ogc_fid;


ALTER TABLE ONLY communes ALTER COLUMN ogc_fid SET DEFAULT nextval('communes_ogc_fid_seq'::regclass);
