nens / threedi-schematisation-editor

QGIS tool for editing schematisations
0 stars 0 forks source link

Identify schema version of old spatialites TOPDESK 2406 0054 #241

Closed leendertvanwolfswinkel closed 2 months ago

leendertvanwolfswinkel commented 3 months ago

In the current database schema, the schema version is stored in schema_version.version_num. In older spatialites, this table does not exist. The schema version for such older sqlites can be derived from south_migrationhistory.migration: it is the first 4 characters of the last record in this table.

When I try to load such an old sqlite with the schematisation editor, I get this message:

image.png

It is perfectly possible to migrate even these old spatialites to the current schema version. So I think that if the schema_version table cannot be found, it should look for the south_migrationhistory table to derive the schema version number and propose to migrate it to the current schema version.

Example data: bwn_waar_woud_spek_eet.zip

leendertvanwolfswinkel commented 3 months ago

@ldebek Perfect, please merge