Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
khellang committed Feb 18, 2019
1 parent 2ba9c2f commit 3eed980
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ public override MethodCallCodeFragment GenerateFluentApi(IIndex index, IAnnotati
if (annotation.Name == NpgsqlAnnotationNames.IndexCollation)
return new MethodCallCodeFragment(nameof(NpgsqlIndexBuilderExtensions.ForNpgsqlHasCollation), annotation.Value);
if (annotation.Name == NpgsqlAnnotationNames.IndexSortOrder)
return new MethodCallCodeFragment(nameof(NpgsqlIndexBuilderExtensions.ForNpgsqlHasDescendingOrder), annotation.Value);
return new MethodCallCodeFragment(nameof(NpgsqlIndexBuilderExtensions.ForNpgsqlHasSortOrder), annotation.Value);
if (annotation.Name == NpgsqlAnnotationNames.IndexNullSortOrder)
return new MethodCallCodeFragment(nameof(NpgsqlIndexBuilderExtensions.ForNpgsqlHasNullsFirst), annotation.Value);
return new MethodCallCodeFragment(nameof(NpgsqlIndexBuilderExtensions.ForNpgsqlHasNullSortOrder), annotation.Value);
if (annotation.Name == NpgsqlAnnotationNames.IndexInclude)
return new MethodCallCodeFragment(nameof(NpgsqlIndexBuilderExtensions.ForNpgsqlInclude), annotation.Value);

Expand Down
8 changes: 4 additions & 4 deletions src/EFCore.PG/Extensions/NpgsqlIndexBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ public static IndexBuilder ForNpgsqlHasCollation(
}

/// <summary>
/// The PostgreSQL index order to be used.
/// The PostgreSQL index sort ordering to be used.
/// </summary>
/// <remarks>
/// https://www.postgresql.org/docs/current/static/indexes-ordering.html
/// </remarks>
/// <param name="indexBuilder"> The builder for the index being configured. </param>
/// <param name="values"> The sort order to use for each column. </param>
/// <returns> A builder to further configure the index. </returns>
public static IndexBuilder ForNpgsqlHasDescendingOrder(
public static IndexBuilder ForNpgsqlHasSortOrder(
[NotNull] this IndexBuilder indexBuilder,
[CanBeNull] params SortOrder[] values)
{
Expand All @@ -99,15 +99,15 @@ public static IndexBuilder ForNpgsqlHasDescendingOrder(
}

/// <summary>
/// The PostgreSQL index NULL ordering to be used.
/// The PostgreSQL index NULL sort ordering to be used.
/// </summary>
/// <remarks>
/// https://www.postgresql.org/docs/current/static/indexes-ordering.html
/// </remarks>
/// <param name="indexBuilder"> The builder for the index being configured. </param>
/// <param name="values"> The sort order to use for each column. </param>
/// <returns> A builder to further configure the index. </returns>
public static IndexBuilder ForNpgsqlHasNullsFirst(
public static IndexBuilder ForNpgsqlHasNullSortOrder(
[NotNull] this IndexBuilder indexBuilder,
[CanBeNull] params NullSortOrder[] values)
{
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.PG/Metadata/INpgsqlIndexAnnotations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Npgsql.EntityFrameworkCore.PostgreSQL.Metadata
public interface INpgsqlIndexAnnotations : IRelationalIndexAnnotations
{
/// <summary>
/// The method to be used, or <c>null</c> if it hasn't been specified.
/// The method to be used, or <c>null</c> if it hasn't been specified. <c>null</c> selects the default (currently <c>btree</c>).
/// </summary>
/// <remarks>
/// http://www.postgresql.org/docs/current/static/sql-createindex.html
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.PG/Metadata/NpgsqlIndexAnnotations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected NpgsqlIndexAnnotations([NotNull] RelationalAnnotations annotations)
}

/// <summary>
/// The method to be used, or <c>null</c> if it hasn't been specified.
/// The method to be used, or <c>null</c> if it hasn't been specified. <c>null</c> selects the default (currently <c>btree</c>).
/// </summary>
/// <remarks>
/// http://www.postgresql.org/docs/current/static/sql-createindex.html
Expand Down
6 changes: 1 addition & 5 deletions src/EFCore.PG/Migrations/NpgsqlMigrationsSqlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ static IndexColumn[] GetIndexColumns(CreateIndexOperation operation)
return columns;
}

struct IndexColumn
readonly struct IndexColumn
{
public IndexColumn(string name, string @operator, string collation, SortOrder sortOrder, NullSortOrder nullSortOrder)
{
Expand All @@ -1320,13 +1320,9 @@ public IndexColumn(string name, string @operator, string collation, SortOrder so
}

public string Name { get; }

public string Operator { get; }

public string Collation { get; }

public SortOrder SortOrder { get; }

public NullSortOrder NullSortOrder { get; }
}

Expand Down

0 comments on commit 3eed980

Please sign in to comment.