Skip to content

Commit

Permalink
adjustment for pk column tracking after changing that code
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Apr 23, 2024
1 parent 33b1253 commit b001b79
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Weasel.Postgresql/Tables/Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ public IReadOnlyList<string> PrimaryKeyColumns
{
get
{
if (!_primaryKeyColumns.Any())
{
_primaryKeyColumns.AddRange(_columns.Where(x => x.IsPrimaryKey).Select(x => x.Name));
}

return _primaryKeyColumns;
}
}
Expand Down Expand Up @@ -383,6 +378,7 @@ public ColumnExpression AsPrimaryKey()
{
Column.IsPrimaryKey = true;
Column.AllowNulls = false;
_parent._primaryKeyColumns.Fill(Column.Name);
return this;
}

Expand Down Expand Up @@ -501,6 +497,7 @@ public ColumnExpression PartitionByRange()
_parent.PartitionExpressions.Add(Column.Name);

Column.IsPrimaryKey = true;
_parent._primaryKeyColumns.Fill(Column.Name);

return this;
}
Expand Down

0 comments on commit b001b79

Please sign in to comment.