Skip to content
Merged
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions src/Migrator/Providers/TransformationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,9 @@ public virtual void AddColumn(string table, string column, MigratorDbType type,
/// <param name="columns">Primary column names</param>
public virtual void AddPrimaryKey(string name, string table, params string[] columns)
{
QuoteColumnNames(columns);
table = QuoteTableNameIfRequired(table);

ExecuteNonQuery(
string.Format("ALTER TABLE {0} ADD CONSTRAINT {1} PRIMARY KEY ({2}) ", table, name,
string.Join(",", QuoteColumnNamesIfRequired(columns))));
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Column names are being quoted twice. The call to QuoteColumnNamesIfRequired(columns) on line 727 modifies the array in-place, but then line 732 calls QuoteColumnNamesIfRequired(columns) again on the already-quoted column names. This will result in double-quoting. Either remove line 727 or use the array directly in line 732 without calling the method again.

Suggested change
string.Join(",", QuoteColumnNamesIfRequired(columns))));
string.Join(",", columns)));

Copilot uses AI. Check for mistakes.
Expand Down
Loading