source: TI01-discovery/branches/ingestAutomation-upgrade/database/spatial_data.sql @ 3834

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery/branches/ingestAutomation-upgrade/database/spatial_data.sql@3834
Revision 3834, 412 bytes checked in by cbyrom, 12 years ago (diff)

Changes to data model:
i) Simplify creation script - to take input parameters and reuse these in a env variable
ii) Create history table direct from the main table
iii) Create procedure to do the backup to the history table
iv) Add trigger to call the backup procedure
v) Tidy up of spatio + temporal tables + additional docs.

RevLine 
[3834]1/*
2 * Table storing spatial information
3 *
4 * C Byrom Apr 08
5 *
6 */
7DROP TABLE spatial_data CASCADE;
[3831]8CREATE TABLE spatial_data
9(
10        spatial_data_id SERIAL primary key,
[3834]11        description character varying (255)
[3831]12);
[3834]13ALTER TABLE spatial_data OWNER TO postgres;
[3831]14
15-- add 2D geometry column, 'geometry', to table - with SRS val of 4326
16select addgeometrycolumn('spatial_data','geometry',4326,'GEOMETRY',2);
Note: See TracBrowser for help on using the repository browser.