Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0.1] Sqlite Migrations: Handle Z and M in spatial columns #23298

Merged
merged 1 commit into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,37 @@ private static readonly HashSet<string> _spatialiteTypes
= new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"GEOMETRY",
"GEOMETRYZ",
"GEOMETRYM",
"GEOMETRYZM",
"GEOMETRYCOLLECTION",
"GEOMETRYCOLLECTIONZ",
"GEOMETRYCOLLECTIONM",
"GEOMETRYCOLLECTIONZM",
"LINESTRING",
"LINESTRINGZ",
"LINESTRINGM",
"LINESTRINGZM",
"MULTILINESTRING",
"MULTILINESTRINGZ",
"MULTILINESTRINGM",
"MULTILINESTRINGZM",
"MULTIPOINT",
"MULTIPOINTZ",
"MULTIPOINTM",
"MULTIPOINTZM",
"MULTIPOLYGON",
"MULTIPOLYGONZ",
"MULTIPOLYGONM",
"MULTIPOLYGONZM",
"POINT",
"POLYGON"
"POINTZ",
"POINTM",
"POINTZM",
"POLYGON",
"POLYGONZ",
"POLYGONM",
"POLYGONZM"
};

private const string IntegerTypeName = "INTEGER";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,25 @@ public override void AddColumnOperation_with_unicode_overridden()
");
}

[ConditionalFact]
public virtual void AddColumnOperation_with_spatial_type()
{
Generate(
new AddColumnOperation
{
Table = "Geometries",
Name = "Geometry",
[SqliteAnnotationNames.Srid] = 4326,
ColumnType = "GEOMETRYZM",
IsNullable = true
});

AssertSql(
@"SELECT AddGeometryColumn('Geometries', 'Geometry', 4326, 'GEOMETRYZM', -1, 0);
");
}


[ConditionalFact]
public void DropSchemaOperation_is_ignored()
{
Expand Down