SET search_path = geolocks,public;

DROP TABLE geometry_lock;

CREATE TABLE geometry_lock (
    id bigserial PRIMARY KEY,
    branch_id bigint NOT NULL,
    commit_id bigint NOT NULL,

    created_by bigint NOT NULL,
    created_at timestamp with time zone NOT NULL DEFAULT now(),

    extent geometry NOT NULL
);

CREATE INDEX geometry_lock_extent_idx
        ON geometry_lock USING gist(extent);

SET search_path = public;
