aboutsummaryrefslogtreecommitdiff
path: root/data/sql/proj_db_table_defs.sql
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-11-04 22:35:57 +0100
committerGitHub <noreply@github.com>2019-11-04 22:35:57 +0100
commit34dc695402ba5d10248ea47bec3ab88ed950eccb (patch)
tree56bfb7962cca13095a85a93af4e372ffac2e0be2 /data/sql/proj_db_table_defs.sql
parent1bee3d54b05d2f6bd406749126ff7d6ac26e7013 (diff)
parent67e987ed84e19dd0ce46bdc529e8a73010af2c66 (diff)
downloadPROJ-34dc695402ba5d10248ea47bec3ab88ed950eccb.tar.gz
PROJ-34dc695402ba5d10248ea47bec3ab88ed950eccb.zip
Merge pull request #1710 from rouault/geoid_model
Add support for GEOIDMODEL
Diffstat (limited to 'data/sql/proj_db_table_defs.sql')
-rw-r--r--data/sql/proj_db_table_defs.sql17
1 files changed, 17 insertions, 0 deletions
diff --git a/data/sql/proj_db_table_defs.sql b/data/sql/proj_db_table_defs.sql
index 8a02acf4..a97e75a8 100644
--- a/data/sql/proj_db_table_defs.sql
+++ b/data/sql/proj_db_table_defs.sql
@@ -1365,6 +1365,23 @@ FOR EACH ROW BEGIN
END;
+
+CREATE TABLE geoid_model(
+ name TEXT NOT NULL,
+ operation_auth_name TEXT NOT NULL,
+ operation_code TEXT NOT NULL,
+ CONSTRAINT pk_geoid_model PRIMARY KEY (name, operation_auth_name, operation_code)
+ -- CONSTRATINT fk_geoid_model_operation FOREIGN KEY (operation_auth_name, operation_code) REFERENCES coordinate_operation(auth_name, code)
+);
+
+CREATE TRIGGER geoid_model_insert_trigger
+BEFORE INSERT ON geoid_model
+FOR EACH ROW BEGIN
+ SELECT RAISE(ABORT, 'insert on geoid_model violates constraint: (operation_auth_name, operation_code) must already exist in coordinate_operation_with_conversion_view')
+ WHERE NOT EXISTS (SELECT 1 FROM coordinate_operation_with_conversion_view covwv WHERE covwv.auth_name = NEW.operation_auth_name AND covwv.code = NEW.operation_code);
+END;
+
+
CREATE TABLE alias_name(
table_name TEXT NOT NULL CHECK (table_name IN (
'unit_of_measure', 'celestial_body', 'ellipsoid',