File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed
NHibernate/Dialect/Schema Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 64
64
<PackageReference Include =" NUnit3TestAdapter" Version =" 4.1.0" />
65
65
<PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.0.0" />
66
66
<PackageReference Include =" FirebirdSql.Data.FirebirdClient" Version =" 8.5.2" />
67
- <PackageReference Include =" Npgsql" Version =" 4.1.9 " />
67
+ <PackageReference Include =" Npgsql" Version =" 6.0.2 " />
68
68
<PackageReference Include =" MySql.Data" Version =" 8.0.27" />
69
69
</ItemGroup >
70
70
<ItemGroup Condition =" $(NhNetFx)" >
Original file line number Diff line number Diff line change @@ -138,7 +138,39 @@ public PostgreSQLColumnMetadata(DataRow rs)
138
138
this . SetNumericalPrecision ( rs [ "NUMERIC_PRECISION" ] ) ;
139
139
140
140
Nullable = Convert . ToString ( rs [ "IS_NULLABLE" ] ) ;
141
- TypeName = Convert . ToString ( rs [ "DATA_TYPE" ] ) ;
141
+ TypeName = Normalize ( Convert . ToString ( rs [ "DATA_TYPE" ] ) ) ;
142
+ }
143
+
144
+ private static string Normalize ( string typeName )
145
+ {
146
+ switch ( typeName )
147
+ {
148
+ case "double precision" :
149
+ return "float8" ;
150
+ case "real" :
151
+ return "float4" ;
152
+ case "smallint" :
153
+ return "int2" ;
154
+ case "integer" :
155
+ return "int4" ;
156
+ case "bigint" :
157
+ return "int8" ;
158
+ }
159
+
160
+ if ( typeName . EndsWith ( "with timezone" ) )
161
+ {
162
+ return ( typeName . StartsWith ( "timestamp" )
163
+ ? typeName . Replace ( "timestamp" , "timestamptz" )
164
+ : typeName . Replace ( "time" , "timetz" ) )
165
+ . Replace ( "with timezone" , "" ) . Trim ( ) ;
166
+ }
167
+
168
+ if ( typeName . EndsWith ( "without timezone" ) )
169
+ {
170
+ return typeName . Replace ( "without timezone" , "" ) . Trim ( ) ;
171
+ }
172
+
173
+ return typeName ;
142
174
}
143
175
}
144
176
You can’t perform that action at this time.
0 commit comments