Description
The snippet below presents the way how Table
class generates UniqueColumn
name. This value is used in several code paths, like CreateForeignKey
and/or generating an unique column name itself.
nhibernate-core/src/NHibernate/Mapping/Table.cs
Lines 859 to 872 in c4fb3dc
string.GetHashCode
is not a stable hashing function, according to the documentation
The hash code itself is not guaranteed to be stable. Hash codes for identical strings can differ across versions of the .NET Framework and across platforms (such as 32-bit and 64-bit) for a single version of the .NET Framework. In some cases, they can even differ by application domain. This implies two subsequent runs of the same program may return different hash codes.
Creating the script then, can have a different outcome when run in two different environments, like .NET Core 2.1
and net461
or even across 32/64 bits.