{"id":19241962,"url":"https://github.com/jaxelr/minimig","last_synced_at":"2025-04-21T09:32:31.961Z","repository":{"id":40316218,"uuid":"176403964","full_name":"Jaxelr/Minimig","owner":"Jaxelr","description":"dotnet global tool for database migrations","archived":false,"fork":false,"pushed_at":"2025-03-20T16:48:05.000Z","size":1960,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T12:03:56.633Z","etag":null,"topics":["migrator","mysql","postgresql","sql-server"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jaxelr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-19T02:07:27.000Z","updated_at":"2025-03-20T16:46:21.000Z","dependencies_parsed_at":"2023-02-11T00:30:50.822Z","dependency_job_id":"cf1ae07f-cc9d-4d4e-8e29-fcc7718786c8","html_url":"https://github.com/Jaxelr/Minimig","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaxelr%2FMinimig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaxelr%2FMinimig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaxelr%2FMinimig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaxelr%2FMinimig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaxelr","download_url":"https://codeload.github.com/Jaxelr/Minimig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250032159,"owners_count":21363781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["migrator","mysql","postgresql","sql-server"],"created_at":"2024-11-09T17:13:02.748Z","updated_at":"2025-04-21T09:32:31.491Z","avatar_url":"https://github.com/Jaxelr.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minimig\n\nMinimig is a forward-only, database migrator for SQL Server, PostgreSQL and MySQL.\n\n## Build Status\n\n| Appveyor  | Branch | Coverage |\n| :---:     | :---: | :--: |\n| [![Build status][build-master-img]][build-master] | master | [![CodeCov][codecov-master-img]][codecov-master] |\n\n## Packages\n\nPackage | NuGet (Stable) | MyGet (Prerelease)\n| :--- | :---: | :---: |\n| Minimig | [![NuGet][nuget-mig-img]][nuget-mig] | [![MyGet][myget-mig-img]][myget-mig] |\n\n## Installation\n\nEasiest installation is via dotnet global tools running `dotnet tool install --global Minimig` from your terminal.\n\nTo install the prerelease version (from myget), you can add the option `--add-source https://www.myget.org/F/minimig/api/v3/index.json`\n\n## Usage\n\n### Creating Migrations\n\nA migration is just plain T-SQL saved in a .sql file. Individual commands are separated with the `GO` keyword for sql server, just like when using [SSMS](https://msdn.microsoft.com/en-us/library/mt238290.aspx). \n\n\u003e In the case of mysql and postgresql, the separator used is the semicolon (;) since `GO` is not supported on those databases\n\nFor example:\n\n```sql\nCREATE TABLE One\n(\n  Id int not null identity(1,1),\n  Name nvarchar(50) not null,\n  \n  constraint PK_One primary key clustered (Id)\n)\nGO\n\nINSERT INTO One (Name) VALUES ('Person')\nGO\n```\n\n\u003e Migrations are executed as a transaction by default, which allows them to be rolled back if any command fails. You can disable this transaction for a specific migration by beginning the file with `-- no transaction --`.\n\nWe recommend prefixing migration file names with a zero-padded number so that the migrations are listed in chronological order. For example, a directory of migrations might look like:\n\n``` cmd\n0001 - Add Users table.sql\n0002 - Add Posts.sql\n0003 - Insert default users.sql\n0004 - Add auth columns to Users.sql\n0005 - Drop tables One To Three.sql\n...\n```\n\n### Running Migrations\n\nMigrations run from the command line, in order to allow for automation to be used.\n\n#### Command Line\n\nTo run migrations the typical usage is:\n\n``` cmd\nmig --folder=\"c:\\path\\to\\migrations\" --connection=\"Persist Security Info=False;Integrated Security=true;Initial Catalog=MyDatabase;server=localhost\" --provider=sqlserver\n```\n\u003e By default the provider used is Sql Server\n\nIf you use integrated auth, you can use the `--database` and `--server` arguments instead of supplying a connection string (server defaults to \"localhost\").\n\n``` cmd\nmig --folder=\"c:\\\\path\\\\to\\\\migrations\" --database=MyLocalDatabase --server=MyServer --provider=sqlserver\n```\n\nUse `mig --help` to show the complete set of options:\n\n``` cmd\nUsage: Minimig [OPTIONS]+\nRuns all *.sql files in the directory --f=\u003cfolder\u003e specified.\n  The databse connection can be specified using the following combinations:\n  -A connection string with the --connection along a --provider\n      if no provider is specified, the program defaults to sqlserver.\n  -Minimig can generate an integrated auth connection string using\n      the --database and optional --server arguments, along a --provider.\n\n  -h, --help                 Shows this help message.\n  -c, --connection=VALUE     A connection string (can be PostgreSQL or \n                               SQLServer or MySQL). For integrated auth, you\n                               can use --database and --server instead.\n  -d, --database=VALUE       Generates an integrated auth connection string\n                               for the specified database.\n  -s, --server=VALUE         Generates an integrated auth connection string\n                               with the specified server (default: localhost).\n  -f, --folder=VALUE         The folder containing your .sql migration files\n                               (defaults to current working directory).\n      --timeout=VALUE        Command timeout duration in seconds (default:\n                               30).\n      --preview              Run outstanding migrations, but roll them back.\n  -p, --provider=VALUE       Use a specific database provider options:\n                               sqlserver (default), postgresql, mysql.\n      --global               Run all outstanding migrations in a single\n                               transaction, if possible.\n      --table=VALUE          Name of the table used to track migrations\n                               (default: Migrations).\n      --schema=VALUE         Name of the schema to be used to track\n                               migrations (default: dbo for sqlserver, public\n                               for postgresql, mysql for mysql).\n      --force                Will rerun modified migrations.\n      --version              Print version number.\n      --count                Print the number of outstanding migrations.\n```\n\n### Reverting Migrations\n\nMinimig has no such concept. It is a forward-only tool. This is done to keep a minimalistic approach.\n\n### Running Migrations on CI\n\nIt is relatively trivial  to configure a docker sql image and run minimig on a ci in order to test your sql migrations, a sample is included on the [following repository](https://github.com/Jaxelr/ci-run-migrations)\n\n### Uninstallation\n\nFor uninstallation execute `dotnet tool uninstall --global Minimig` from terminal.\n\n## Credit\n\nThis library started as a fork from Mayflower.net which is [inactive](https://github.com/bretcope/Mayflower.NET)\n\n## License\n\nMinimig is available under the [MIT License](https://github.com/Jaxelr/Minimig/blob/master/LICENSE)\n\n## Logo license\n\nMinimig's icon was created by [Freepik](https://www.freepik.com/) under [Creative Commons license 3.0](http://creativecommons.org/licenses/by/3.0/)\n\n[build-master-img]: https://ci.appveyor.com/api/projects/status/t7e2n08lgqb4jvui/branch/master?svg=true\n[build-master]: https://ci.appveyor.com/project/Jaxelr/minimig/branch/master\n[nuget-mig-img]: https://img.shields.io/nuget/v/Minimig.svg\n[nuget-mig]: https://www.nuget.org/packages/Minimig\n[myget-mig-img]: https://img.shields.io/myget/minimig/v/Minimig.svg\n[myget-mig]: https://www.myget.org/feed/minimig/package/nuget/Minimig\n[codecov-master-img]: https://codecov.io/gh/Jaxelr/Minimig/branch/master/graph/badge.svg\n[codecov-master]: https://codecov.io/gh/Jaxelr/Minimig/branch/master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxelr%2Fminimig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaxelr%2Fminimig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxelr%2Fminimig/lists"}