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

Subversion URL:
Revision 3834, 532 bytes checked in by cbyrom, 13 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.

2 * Table to relate spatial and temporal data to each other and to a particular ingested document
3 *
4 * C Byrom Apr 08
5 *
6 */
7DROP TABLE spatial_temporal_data CASCADE;
8CREATE TABLE spatial_temporal_data
10        spatial_temporal_data_id SERIAL PRIMARY KEY,
11        original_record_id      int references original_document(original_document_id),
12        spatial_data_id         int references spatial_data(spatial_data_id),
13        temporal_data_id        int references temporal_data(temporal_data_id)
15ALTER TABLE spatial_temporal_data OWNER TO postgres;
Note: See TracBrowser for help on using the repository browser.