Is your feature request related to a problem? Please describe.
The VersionInfo table has the column AppliedOn to note when a migration was applied on the database.
The AppliedOn column value is updated with the expected date when updating a database through a direct connection but it uses a hardcoded date when generating SQL scripts.
Describe the solution you'd like
SQL scripts use a date calculated when the script is executed rather than the date when the script was generated.
Additional context
The date is hardcoded in the implementations of IVersionLoader (note the value that is used for the AppliedOn column):
|
protected virtual InsertionDataDefinition CreateVersionInfoInsertionData(long version, string description) |
|
{ |
|
return new InsertionDataDefinition |
|
{ |
|
new KeyValuePair<string, object>(VersionTableMetaData.ColumnName, version), |
|
new KeyValuePair<string, object>(VersionTableMetaData.AppliedOnColumnName, DateTime.UtcNow), |
|
new KeyValuePair<string, object>(VersionTableMetaData.DescriptionColumnName, description), |
|
}; |
|
} |
|
protected virtual InsertionDataDefinition CreateVersionInfoInsertionData(long version, string description) |
|
{ |
|
return new InsertionDataDefinition |
|
{ |
|
new KeyValuePair<string, object>(VersionTableMetaData.ColumnName, version), |
|
new KeyValuePair<string, object>(VersionTableMetaData.AppliedOnColumnName, DateTime.UtcNow), |
|
new KeyValuePair<string, object>(VersionTableMetaData.DescriptionColumnName, description) |
|
}; |
|
} |
Is this a feature you'd like to submit a PR for?
Yes.
Is your feature request related to a problem? Please describe.
The
VersionInfotable has the columnAppliedOnto note when a migration was applied on the database.The
AppliedOncolumn value is updated with the expected date when updating a database through a direct connection but it uses a hardcoded date when generating SQL scripts.Describe the solution you'd like
SQL scripts use a date calculated when the script is executed rather than the date when the script was generated.
Additional context
The date is hardcoded in the implementations of
IVersionLoader(note the value that is used for theAppliedOncolumn):fluentmigrator/src/FluentMigrator.Runner.Core/VersionLoader.cs
Lines 140 to 148 in 2143451
fluentmigrator/src/FluentMigrator.Runner.Core/ConnectionlessVersionLoader.cs
Lines 197 to 205 in 2143451
Is this a feature you'd like to submit a PR for?
Yes.