Releases: AngelMunoz/Migrondi
v1.0.0-beta-010
- Allow manual handling of transactions
- update dependencies
- if a rollback is empty, stop there.
- known issue: if the rollback is made of comments it will still try to run
Full Changelog: v1.0.0-beta-009...v1.0.0-beta-010
v1.0.0-beta-009
This release adds the Microsoft.Extensions.Logging package to hide some details of the creation of an IMigrondi instance when using the library code.
Breaking Changes
Change the signature of MigrondiFactory to avoid asking extra information and orchestration from users.
previously
let factory = Migrondi.MigrondiFactory(logger)
let config = MigrondiConfig.Default
let rootDir =
Uri(__SOURCE_DIRECTORY__ + $"{Path.DirectorySeparatorChar}", UriKind.Absolute)
let migrationsDir =
Uri(Config.ensureWellFormed config.migrations, UriKind.Relative)
let migrondi = factory.Invoke(config, rootDir, migrationsDir)
Now:
let config = MigrondiConfig.Default
let migrondi = Migrondi.MigrondiFactory(config, ".")
On the follwing releases that MigrondiFactory name may be changed to simply Create
Full Changelog: v1.0.0-beta-008...v1.0.0-beta-009
v1.0.0-beta-008
Woops... I also missed a method on the public API on the last release, here's the good one!
As I was saying before:
This Version adds a small convenience API that was missing on the IMigrondi interface
Now it should be very simple to create and run migrations programmatically, here's an example how you can create and run migrations from an F# script!
#r "nuget: Migrondi.Core, 1.0.0-beta-008"
#r "nuget: Microsoft.Extensions.Logging"
#r "nuget: Microsoft.Extensions.Logging.Console"
open System
open System.IO
open Migrondi.Core
open Microsoft.Extensions.Logging
module Config =
let getLogger loggerName =
let loggerFactory =
LoggerFactory.Create(fun builder ->
builder.SetMinimumLevel(LogLevel.Debug).AddSimpleConsole() |> ignore
)
loggerFactory.CreateLogger loggerName
let ensureWellFormed (migrationsDir: string) =
// when you're using URIs "./path" is not the same as "./path/"
// the first one is a file and the second one is a directory
// so ensure you always end your paths with a directory separator
if Path.EndsInDirectorySeparator(migrationsDir) then
migrationsDir
else
$"{migrationsDir}{Path.DirectorySeparatorChar}"
let logger = Config.getLogger("sample-app")
let factory = Migrondi.MigrondiFactory(logger)
let config = MigrondiConfig.Default
let rootDir =
Uri(__SOURCE_DIRECTORY__ + $"{Path.DirectorySeparatorChar}", UriKind.Absolute)
let migrationsDir =
Uri(Config.ensureWellFormed config.migrations, UriKind.Relative)
let migrondi = factory.Invoke(config, rootDir, migrationsDir)
// Let's create a new Migration, since this is just an I/O operation
// there's no need to initialize the database yet, but ideally
// you would want to do that anyways for safety
migrondi.RunNew(
"add-test-table",
"create table if not exists test (id int not null primary key);",
"drop table if exists test;"
)
// Before we can talk to the database we need to initialize the migrondi object
// this will ensure that the migrations directory exists, and the required pieces
// of information are available in the database to see if it is ready to accept migrations.
migrondi.Initialize()
// once that the migrondi service is initialized we can try to commmunicate to the
// database and in this case go for a dry run
let applied = migrondi.DryRunUp()
logger.LogInformation(
$"List of the migrations that would have been ran:\n\n%A{applied}"
)
Full Changelog: v1.0.0-beta-006...v1.0.0-beta-008
v1.0.0-beta-007
This Version adds a small convenience API that was missing on the IMigrondi interface
Now it should be very simple to create and run migrations programmatically, here's an example how you can create and run migrations from an F# script!
Please ignore this release and check the notes on v1.0.0-beta-008
Full Changelog: v1.0.0-beta-006...v1.0.0-beta-007
v1.0.0-beta-006
This release doesn't add up much, I'm drive testing the library portion of this project in https://github.com/AngelMunoz/MigrondiUI so once I get in better shape for that project, I'll start tweaking parts of the API before moving to RC stage.
Add missing helpers for the MigrondiDriver
type as well as removing an extra namespace in the Migrondi file.
Full Changelog: v1.0.0-beta-005...v1.0.0-beta-006
v1.0.0-beta-005
This release is to switch out some Public API names and switch the factory functions to classes
I'm dogfooding this project from a C# application and found a few issues and weirdness from using the library side that I'm trying to address with these changes.
And also added a simpler way to initialize the migrondi service (in case you don't care about the internal services of migrondi
F# Code
let migrondiFactory = Migrondi.MigrondiFactory(logger)
let migrondi: IMigrondi = migrondiFactory.Invoke(config, projectRoot, migrationsDir)
migrondi.DryRunUp()
C# code
var migrondiFactory = Migrondi.MigrondiFactory(logger);
IMigrondi migrondi = migrondiFactory(sconfig, rootProject, migrationsDir);
migrondi.DryRunUp();
Full Changelog: v1.0.0-beta-004...v1.0.0-beta-005
v1.0.0-beta-004
Changes in this version
- Serialization API
- Split into Configuration Serializer and Migration Serializer - this was made in order to make it easier to construct the services and replace them individually where needed vs the previous API that required a nested set of interfaces to get to the correct API
- Migrate from the internal async implementation to IcedTasks - Iced tasks keeps the benefit of using a performant Task-based API keeping the benefits of the async model from F# so there's less
Async <-> Task
conversion interop - Implement the missing bits of the Migrondi Service's Async API so you can start coding against it!
Also, docs are starting to get in shape I think there's less things to worry about now and if I don't get any crazy ideas we might get an RC version soon.
Full Changelog: v1.0.0-beta-003...v1.0.0-beta-004
Updates to Public API
In the last preview for some reason I forgot to add and update the signature files to properly limit the public API of the Core project
This should be fixed now and should reflect the current desired public API offering
Full Changelog: https://github.com/AngelMunoz/Migrondi/compare/v1.0.0-beta-001..v1.0.0-beta-003
Update Public API
Renamed a few APIs to to make naming consistent
Full Changelog: v1.0.0-beta-001...v1.0.0-beta-002
First v1 Preview
Hey there, It's been quite a while!
Today I have come to announce the first v1 beta for migrondi!
Given that I'm very clear what this tool is aiming for, and that the existing functionality has been like it for a complete while I decided to re-architect most of the core code base to enable a bunch of cool stuff for the future, especially around using this as a library in your own projects so you can have better control over how everything is executed!
This means that technically it is a breaking change from older releases specially around the CLI, but I made this tool specifically to be compatible with v0 script format, so it should be a drop-in replacement in that sense.
the CLI is a little bit easier to use with less typing for obvious choices like the number of migrations you want to run up/down.
So, this time I'm releasing two artifacts:
- Migrondi (the tool we already know)
- Migrondi.Core (The library that powers the CLI but now at your disposal!)
Oh by the way, the core library should be C#/VB compatible (e.g. no F# specific types) :) so feel free to try it out specially from the C#/VB side!
I will eventually update the existing vscode tool and related projects, but in the meantime this should be ready to try!
Full Changelog: v0.7.1...v1.0.0-beta-001