Open
Description
With a PostgreSql database, when I run a schema validation the following happens:
- Property mapped as
timestamp
against atimestamptz
column => Schema Validation Failed (as expected) - Property mapped as
timestamptz
against atimestamp
column => Schema Validation OK (not as expected)
After checking the repository code, I found where the error might be: src/NHibernate/Mapping/Table.cs, method ValidateColumns
:
bool typesMatch =
column
.GetSqlType(dialect, mapping)
.StartsWith(columnInfo.TypeName, StringComparison.OrdinalIgnoreCase);
Is it correct to check if both types match (mapping and column) with .StartsWith(...)
?
Wouldn't be better to use .Equals(...)
here?