Sql Server's "datetime" type has severely limited range and precision. MS introduced the "datetime2" type with Sql Server 2008, to address these issues, and that has been the recommended datatype in new applications, since then.
We've been using FluentMigrator to create tables against a Sql Server 2012 database (using the SqlServer2012ProcessorFactory), and we've been seeing AsDateTime() columns being created with "datetime" types, instead of "datetime2".
Since our system requires millisecond precision, and the "datetime" type doesn't provide millisecond precision, that's a problem for us.
So now we're faced with two issues:
- How to create a migration that creates a column with type "datetime2"?
- How to create a migration that converts a column with type "datetime" to type "datetime2"?
and a question:
- Should FluentMigrator create columns with type "datetime2" by default, when running against SqlServer 2008+?