def add_spatial_version_related_fields(sender, **kwargs):
    if connection_created.disconnect(add_spatial_version_related_fields, sender=DatabaseWrapper):
        spatial_version = connection.ops.spatial_version[0]
        if spatial_version >= 4:
            SpatialiteSpatialRefSys.add_to_class('srtext', models.CharField(max_length=2048))
            SpatialiteGeometryColumns.add_to_class('type', models.IntegerField(db_column='geometry_type'))
        else:
            SpatialiteGeometryColumns.add_to_class('type', models.CharField(max_length=30))
Adds fields after establishing a database connection to prevent database
dataset/ETHPy150Open django/django/django/contrib/gis/db/backends/spatialite/models.py/add_spatial_version_related_fields