GispoCoding / hame-ryhti

HAME regional land use planning database compatible with national Ryhti data model
MIT License
0 stars 0 forks source link

24 lähtötietoihin valmiiksi hallinnolliset rajat #307

Open msorvoja opened 1 week ago

msorvoja commented 1 week ago

Fix #24

Still missing tests.

@Rikuoja One test fails since the revision file has been edited by hand. This is because alembic overwrites an optional field containing geometry to nullable=False. That won't do since the code list containing the names of the administrative regions must be loaded into the administrative_region code table before the geometries can be inserted. Hence, the geometry field is momentarily filled with NULL values.

msorvoja commented 4 days ago

@Rikuoja Declaring geom field as geom = Column(Geometry(geometry_type="MULTIPOLYGON", srid=3067), nullable=True) instead of geom: Mapped[Optional[MultiPolygon]] fixed the problem where alembic forced the field to be non-nullable. A bug in alembic or geoalcemy2?