unique id for events + creation date

This commit is contained in:
cquest 2016-04-14 19:05:59 +02:00
parent 183664f1fb
commit 49b116bb5f
2 changed files with 50 additions and 1 deletions

View file

@ -41,6 +41,20 @@ CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
COMMENT ON EXTENSION postgis IS 'PostGIS geometry, geography, and raster spatial types and functions';
--
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;
--
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';
SET search_path = public, pg_catalog;
--
@ -72,10 +86,19 @@ CREATE TABLE events (
events_where geometry,
events_when timestamp with time zone,
events_type text,
events_tags json
events_tags json,
events_id uuid DEFAULT uuid_generate_v4(),
createdate timestamp without time zone DEFAULT now()
);
--
-- Name: events_idx_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX events_idx_id ON events USING btree (events_id);
--
-- Name: events_idx_what; Type: INDEX; Schema: public; Owner: -
--