From 0476db2b05b9232b7c579901cf8a873ef34ae62f Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Wed, 18 Nov 2020 17:19:41 +0100
Subject: Database: update to EPSG v10.007

---
 data/sql/metadata.sql | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'data/sql/metadata.sql')

diff --git a/data/sql/metadata.sql b/data/sql/metadata.sql
index 8db35745..3c21636c 100644
--- a/data/sql/metadata.sql
+++ b/data/sql/metadata.sql
@@ -1,2 +1,2 @@
-INSERT INTO "metadata" VALUES('EPSG.VERSION', 'v10.003');
-INSERT INTO "metadata" VALUES('EPSG.DATE', '2020-10-05');
+INSERT INTO "metadata" VALUES('EPSG.VERSION', 'v10.007');
+INSERT INTO "metadata" VALUES('EPSG.DATE', '2020-11-18');
-- 
cgit v1.2.3


From eef73e3eca2959768563d2dbb95a591c68b1d807 Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Mon, 30 Nov 2020 14:00:46 +0100
Subject: Database: add metadata with the version number of the database layout
 and check it in the code

This is aimed at detecting running a PROJ version against a proj.db that is not
meant to work with it. This happens sometimes in complex setups mixing PROJ
versions. Hopefully this will help spotting the issue earlier.
---
 data/sql/metadata.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'data/sql/metadata.sql')

diff --git a/data/sql/metadata.sql b/data/sql/metadata.sql
index 3c21636c..adcee507 100644
--- a/data/sql/metadata.sql
+++ b/data/sql/metadata.sql
@@ -1,2 +1,13 @@
+-- Version of the database structure.
+-- The major number indicates an incompatible change (e.g. table or column
+-- removed or renamed).
+-- The minor number is incremented if a backward compatible change done, that
+-- is the new database can still work with an older PROJ version.
+-- When updating those numbers, the DATABASE_LAYOUT_VERSION_MAJOR and
+-- DATABASE_LAYOUT_VERSION_MINOR constants in src/iso19111/factory.cpp must be
+-- updated as well.
+INSERT INTO "metadata" VALUES('DATABASE.LAYOUT.VERSION.MAJOR', 1);
+INSERT INTO "metadata" VALUES('DATABASE.LAYOUT.VERSION.MINOR', 0);
+
 INSERT INTO "metadata" VALUES('EPSG.VERSION', 'v10.007');
 INSERT INTO "metadata" VALUES('EPSG.DATE', '2020-11-18');
-- 
cgit v1.2.3

