You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Index and constraint names are not checked against implicit identity/serial sequences #115
#82 (PR #106) adds the model's tables, views and sequences to the PostgreSQL relation-namespace check. The sequence PostgreSQL creates implicitly for an identity or serial column is not in the model, so it is still missed:
b.ToTable("rows");// "Id" integer GENERATED BY DEFAULT AS IDENTITY (Npgsql's default)b.HasComplexIndex(x =>x.Code,indexName:"rows_Id_seq");
This scaffolds cleanly and fails at apply. Checked on PostgreSQL 18: ERROR: relation "rows_Id_seq" already exists (42P07).
Reaching it takes a deliberately odd name. It is filed because #82's check now looks complete when it is not.
Fix
Add {table}_{column}_seq for every column Npgsql maps as identity or serial (Npgsql:ValueGenerationStrategy IdentityByDefault/IdentityAlways/SerialColumn, or a serial store type) to the relation namespace in ValidateNamesAcrossKinds. PostgreSQL truncates and de-duplicates that name when it is long or taken, so compare only names under 63 bytes, and say so. Loud.
Activity
fix: check names against the sequences of identity and serial columns (…
Merge pull request #125 from CaffeinatedCoder/fix/115-implicit-sequen…