Skip to content

Commit

Permalink
Just always add PostGIS when the plugin is used
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Dec 30, 2021
1 parent f577c05 commit 351d6a8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 51 deletions.
1 change: 1 addition & 0 deletions EFCore.PG.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<s:Boolean x:Key="/Default/UserDictionary/Words/=niladic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pluralizer/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Poolable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=postgis/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pushdown/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=regconfig/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=regdictionary/@EntryIndexedValue">True</s:Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,9 @@ namespace Npgsql.EntityFrameworkCore.PostgreSQL.Internal;

public class NpgsqlNetTopologySuiteConventionSetPlugin : IConventionSetPlugin
{
private readonly IRelationalTypeMappingSource _typeMappingSource;
private readonly IDbContextOptions _options;

public NpgsqlNetTopologySuiteConventionSetPlugin(IRelationalTypeMappingSource typeMappingSource, IDbContextOptions options)
{
_typeMappingSource = typeMappingSource;
_options = options;
}

public virtual ConventionSet ModifyConventions(ConventionSet conventionSet)
{
conventionSet.ModelFinalizingConventions.Add(new NpgsqlNetTopologySuiteExtensionDiscoveryConvention(_typeMappingSource));
conventionSet.ModelFinalizingConventions.Add(new NpgsqlNetTopologySuiteExtensionAddingConvention());

return conventionSet;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

// ReSharper disable once CheckNamespace
namespace Npgsql.EntityFrameworkCore.PostgreSQL.Internal;

public class NpgsqlNetTopologySuiteExtensionAddingConvention : IModelFinalizingConvention
{
/// <inheritdoc />
public virtual void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConventionContext<IConventionModelBuilder> context)
=> modelBuilder.HasPostgresExtension("postgis");
}

This file was deleted.

0 comments on commit 351d6a8

Please sign in to comment.