Replies: 1 comment
-
@Volodymyr I think this idea could be of interest to you. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been using FluentMigrator for over 3 years now, and have developed various best practices and thoughts around using FluentMigrator. While FluentMigrator 3.0 supports dependency injection, the next evolution of any injectable system is a good set of default values. Enter a new csproj/nuget package called FluentMigrator.Opinions (not yet created).
As an example of a good set of default values, consider a workflow where you develop thousands of database migrations. After awhile, the old migrations lose their meaning and it makes sense to "re-baseline" and "archive" old migrations. Some tools exist today to help support such workflows, but there is no unified, parsimonious architecture that allows such workflows to work flawlessly.
Here are some ideas:
Archiving Database Migrations.
.cs
files are not deleted, but archived. We literally copy the code into a folder calledArchive/Migrations
and use the .NET Core SDK project auto-globbing rules to not compile these items. They're still searchable via Control+Shift+F (Find In All Files, including External Items).IProvidesCallerFilePath
interface to their Migration, we can automatically identify the path to.cs
files needing archiving, and move them for the user. TheIProvidesCallerFilePath
is a convention whereby each migration would have a[CallerFilePath]
on it via implementing a single interfacestring CallerFilePath {get; set;}
. The FluentMigrator toolchain would then verify the implemented property has the[CallerFilePath]
attribute.Create the database if it doesn't already exist. This is very high complexity feature, due to all the idiosyncratic ways to create databases. Original target would be to support Postgres, SqlServer, and MySql variants.
Alternative
ISyntax
implementations.Beta Was this translation helpful? Give feedback.
All reactions