From 3e949f6185164533b3cec491f7007570da899051 Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Sun, 6 Sep 2020 13:37:11 +0200 Subject: [PATCH] Add meta fields to schema. Many tables now have a JSON (jsonb) column to hold unstructured data. --- etc/db/schema-template.sql | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/etc/db/schema-template.sql b/etc/db/schema-template.sql index f119760..34f32bf 100644 --- a/etc/db/schema-template.sql +++ b/etc/db/schema-template.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 11.7 --- Dumped by pg_dump version 12.2 +-- Dumped from database version 12.4 +-- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; @@ -172,6 +172,8 @@ NOTE: The proper way of doing this would be to define an EngineeringCRS in the s SET default_tablespace = ''; +SET default_table_access_method = heap; + -- -- Name: labels; Type: TABLE; Schema: _SURVEY__TEMPLATE_; Owner: postgres -- @@ -202,7 +204,8 @@ CREATE TABLE _SURVEY__TEMPLATE_.raw_shots ( objref integer NOT NULL, tstamp timestamp with time zone NOT NULL, hash text NOT NULL, - geometry public.geometry(Point,_EPSG__CODE_) + geometry public.geometry(Point,_EPSG__CODE_), + meta jsonb DEFAULT '{}'::jsonb NOT NULL ); @@ -261,7 +264,8 @@ CREATE TABLE _SURVEY__TEMPLATE_.events_seq ( id integer NOT NULL, remarks text NOT NULL, sequence integer NOT NULL, - point integer NOT NULL + point integer NOT NULL, + meta jsonb DEFAULT '{}'::jsonb NOT NULL ); @@ -301,7 +305,8 @@ ALTER TABLE _SURVEY__TEMPLATE_.events_seq_timed OWNER TO postgres; CREATE TABLE _SURVEY__TEMPLATE_.events_timed ( id integer NOT NULL, remarks text NOT NULL, - tstamp timestamp with time zone NOT NULL + tstamp timestamp with time zone NOT NULL, + meta jsonb DEFAULT '{}'::jsonb NOT NULL ); @@ -328,7 +333,8 @@ CREATE TABLE _SURVEY__TEMPLATE_.preplot_points ( point integer NOT NULL, class character(1) NOT NULL, ntba boolean DEFAULT false NOT NULL, - geometry public.geometry(Point,_EPSG__CODE_) NOT NULL + geometry public.geometry(Point,_EPSG__CODE_) NOT NULL, + meta jsonb DEFAULT '{}'::jsonb NOT NULL ); @@ -362,7 +368,8 @@ CREATE TABLE _SURVEY__TEMPLATE_.raw_lines ( line integer NOT NULL, remarks text DEFAULT ''::text NOT NULL, ntbp boolean DEFAULT false NOT NULL, - incr boolean NOT NULL + incr boolean NOT NULL, + meta jsonb DEFAULT '{}'::jsonb NOT NULL ); @@ -657,7 +664,8 @@ be provided to purge this old data at suitable intervals. CREATE TABLE _SURVEY__TEMPLATE_.final_lines ( sequence integer NOT NULL, line integer NOT NULL, - remarks text DEFAULT ''::text NOT NULL + remarks text DEFAULT ''::text NOT NULL, + meta jsonb DEFAULT '{}'::jsonb NOT NULL ); @@ -695,7 +703,8 @@ CREATE TABLE _SURVEY__TEMPLATE_.final_shots ( objref integer NOT NULL, tstamp timestamp with time zone NOT NULL, hash text NOT NULL, - geometry public.geometry(Point,_EPSG__CODE_) + geometry public.geometry(Point,_EPSG__CODE_), + meta jsonb DEFAULT '{}'::jsonb NOT NULL ); @@ -851,7 +860,8 @@ CREATE TABLE _SURVEY__TEMPLATE_.preplot_lines ( remarks text NOT NULL, ntba boolean DEFAULT false NOT NULL, geometry public.geometry(LineString,_EPSG__CODE_) NOT NULL, - hash text NOT NULL + hash text NOT NULL, + meta jsonb DEFAULT '{}'::jsonb NOT NULL );