SimpleMigrator 2.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global SimpleMigrator --version 2.0.4
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local SimpleMigrator --version 2.0.4
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=SimpleMigrator&version=2.0.4
                    
nuke :add-package SimpleMigrator --version 2.0.4
                    

Simple Migrator


Databases Supported

  • Postgres
  • Cassandra
  • Neo4j
  • Mongo

Usage

Migration files are executed in order, so a date-related naming convention is recommended, but not required. See the example migrations folder.

File extension names are ignored, so feel free to use whatever suits your fancy.

Downward migration scripts must end in .down.<extension>, but are optional.

migrate postgres up|down \
    --connection-string | -c <postgres connection string> \
    --folder | -f <folder of migration files> \
    [--to <migration name to stop at>]
migrate cassandra up|down \
    --host | -h <cassandra hostname> \
    --port | -p <cassandra port> \
    --keyspace | -k <cassandra keyspace> \
    --folder | -f <folder of migration files> \
    [--to <migration name to stop at>]
migrate neo4j up|down \
    --host | -h <neo4j hostname> \
    --port | -p <neo4j port> \
    --username | -u <neo4j username> \
    --password | -w <neo4j password> \
    --database | -d <neo4j database> \
    --folder | -f <folder of migration files> \
    [--to <migration name to stop at>]
migrate mongo up|down \
    --connection-string | -c <mongo host connection string> \
    --database | -d <mongo database> \
    --folder | -f <folder of migration files> \
    [--to <migration name to stop at>]

Postgres

The connection string must be an ADO.NET-compliant connection string. Executes SQL commands from files. All commands in a single file will be executed in a transaction. The timeout for migration scripts is hardcoded to 10m.

Cassandra

Executes CQL queries from files. Only one command allowed per file.

Be careful how you write your migrations since this applies to downward migrations as well.

Warning: does not yet support username/password

Neo4j

Executes Cypher queries from files. Only one command allowed per file, though naturally queries that do multiple things are acceptable.

Be careful how you write your migrations since this applies to downward migrations as well.

Mongo

Executes JSON commands from files.


Contribution

While you have every right to fork this repo and run away with it, I would really appreciate issues, comments, and pull requests if you have them!

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2.2.2 266 3/29/2025
2.2.1 386 5/24/2024
2.2.0 214 5/22/2024
2.1.2 198 5/22/2024
2.1.1 230 5/22/2024 2.1.1 is deprecated because it has critical bugs.
2.0.4 802 8/22/2022
2.0.3 721 8/5/2022
2.0.2 682 8/5/2022 2.0.2 is deprecated because it has critical bugs.
2.0.1 682 8/4/2022 2.0.1 is deprecated because it has critical bugs.
2.0.0 699 8/4/2022 2.0.0 is deprecated because it has critical bugs.
1.3.0 722 8/4/2022 1.3.0 is deprecated because it has critical bugs.