JasperFx / weasel

Database Development Made Easy for .Net
MIT License
65 stars 21 forks source link

Handle PrimaryKeyName longer than Postgres's default NAMEDATALEN limit #49

Closed lngr closed 2 years ago

lngr commented 2 years ago

Postgres automatically truncates index names longer than its internal NAMEDATALEN constant.

NOTICE: identifier "..." will be truncated to "..."

This breaks schema migration, because the new name will be truncated again and the following error is thrown:

Npgsql.PostgresException (0x80004005): 42P07: relation "...« already exists

This PR adds a check whether the truncated names are equal before generating a table delta.