Meg 0.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global Meg --version 0.0.2                
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 Meg --version 0.0.2                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Meg&version=0.0.2                
nuke :add-package Meg --version 0.0.2                

MEG - DotNet Migration Tool (WIP)

Meg is an extremely simple migration command line tool that is inspired by conventions of tools such as rake and ecto. Currently only supports PostgreSQL but will support other providers in the future.

  • create - Creates initial database by name.
  • drop - Drops a database by name.
  • migrate - Runs migrations in the specified migration folder. Defaults to folder "Migrations". Migrations are just SQL scripts.
  • gen - Generates a migration via DSL. TODO.

Install

# Global
dotnet tool install --global meg

meg --help
meg create --help
meg migrate --help
meg drop --help
# Local
dotnet new tool-manifest
dotnet tool install meg

Parameters

Create

$USAGE: meg create [--help] [--dbname <db name>]
                  [--connectionstring <connection string>]
                  [--provider <postgresql|mssql|mysql|sqlite>]

OPTIONS:

    --dbname, -d <db name>
                          Specify the name of the database to create.
    --connectionstring, -c <connection string>
                          Specify the database connection string for the Admin
                          database. Must be able to create DBs with the
                          permissions of the user.
    --provider, -p <postgresql|mssql|mysql|sqlite>
                          Specify the database provider.
    --help                display this list of options.

Drop

$USAGE: meg drop [--help] [--dbname <db name>]
                [--connectionstring <connection string>]
                [--provider <postgresql|mssql|mysql|sqlite>]

OPTIONS:

    --dbname, -d <db name>
                          Specify the name of the database to create.
    --connectionstring, -c <connection string>
                          Specify the database connection string for the Admin
                          database. Must be able to create DBs with the
                          permissions of the user.
    --provider, -p <postgresql|mssql|mysql|sqlite>
                          Specify the database provider.
    --help                display this list of options.

Migrate

$USAGE: meg migrate [--help] [--connectionstring <connection string>]
                   [--migrationdirectory <migration directory>]
                   [--provider <postgresql|mssql|mysql|sqlite>]

OPTIONS:

    --connectionstring, -c <connection string>
                          Specify the database connection string for the
                          database. Must be able to create and update tables
                          with the permissions of the user.
    --migrationdirectory, -i <migration directory>
                          Specify the directory that contains your order-named
                          migration .SQL files.
    --provider, -p <postgresql|mssql|mysql|sqlite>
                          Specify the database provider.
    --help                display this list of options.

Env Vars

You can supplement command line usage with some ENV vars in your project to reduce how often you have to enter params in the command line. Having these set will allow them to be used as defaults.

DB_CONNECTION_STRING
DB_NAME 
DB_PROVIDER
MIGRATION_DIRECTORY
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. 
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.0 210 5/19/2024
2.1.0 207 5/19/2024
2.0.1 241 5/17/2024
2.0.0 301 5/4/2024
1.2.0 928 1/28/2024
1.1.0 962 12/17/2023
1.0.0 1,150 11/30/2023
0.0.3 1,129 11/27/2023
0.0.2 713 11/25/2023
0.0.1 1,535 11/25/2023