{"id":13828829,"url":"https://github.com/jaemk/migrant","last_synced_at":"2025-04-13T08:22:45.778Z","repository":{"id":57638581,"uuid":"76149076","full_name":"jaemk/migrant","owner":"jaemk","description":"Migration management for PostgreSQL/SQLite/MySQL","archived":false,"fork":false,"pushed_at":"2021-03-24T04:18:10.000Z","size":343,"stargazers_count":89,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T00:11:09.462Z","etag":null,"topics":["database","database-migrations","migrations","mysql","postgres","rust","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jaemk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-11T02:12:55.000Z","updated_at":"2025-03-09T11:42:48.000Z","dependencies_parsed_at":"2022-08-30T05:53:06.590Z","dependency_job_id":null,"html_url":"https://github.com/jaemk/migrant","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaemk%2Fmigrant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaemk%2Fmigrant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaemk%2Fmigrant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaemk%2Fmigrant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaemk","download_url":"https://codeload.github.com/jaemk/migrant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681725,"owners_count":21144744,"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":["database","database-migrations","migrations","mysql","postgres","rust","sqlite"],"created_at":"2024-08-04T09:03:12.466Z","updated_at":"2025-04-13T08:22:45.754Z","avatar_url":"https://github.com/jaemk.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Migrant\n[![Build Status](https://travis-ci.org/jaemk/migrant.svg?branch=master)](https://travis-ci.org/jaemk/migrant)\n[![crates.io:migrant](https://img.shields.io/crates/v/migrant.svg?label=migrant)](https://crates.io/crates/migrant)\n\n\u003e Basic migration manager powered by [`migrant_lib`](https://github.com/jaemk/migrant_lib)\n\n\n**Supported databases/features:**\n\n| Feature       |    Backend                            |\n|---------------|---------------------------------------|\n| `postgres`    | Enable postgres connectivity          |\n| `sqlite`      | Enable sqlite connectivity            |\n| `mysql`       | Enable mysql connectivity             |\n| `update`      | Enable `self-update` functionality    |\n\n\n`migrant` will manage all migrations that live under `\u003cproject-dir\u003e/migrations/`, where `project-dir` is the closest\nparent path that contains a `Migrant.toml` configuration file (`..../\u003cproject-dir\u003e/Migrant.toml`).\nThe default migration file location can be modified in your `Migrant.toml` file (`\"migration_location\"`).\nIf the `migration_location` directory doesn't exist, it will be created the first time you create a new migration.\n`migrant` stores all applied migrations in a database table named `__migrant_migrations`.\n\n*Note:* Configuration values prefixed with `env:` in your `Migrant.toml` will be sourced from environment variables.\nFor example, `database_user = \"env:DB_USER\"` will use the value of the environment variable `DB_USER`.\nIf a `.env.` file exists, it will be \"sourced\" automatically before your `Migrant.toml` is loaded.\n\n*Note:* SQL statements are batch executed as is. If you want your migration to happen atomically in a\ntransaction you must manually wrap your statements in a transaction (`begin transaction; ... commit;`).\n\n\n### Installation\n\n**Binary releases:**\n\nSee [releases](https://github.com/jaemk/migrant/releases) for binaries. If you've already installed a binary release, you can update to the latest release via `migrant self update`.\n\n**Building from source:**\n\nBy default `migrant` will build without any features, falling back to using each database's `cli` commands\n(`psql` / `sqlite3` / `mysqlsh`).\nThe `postgres`, `rusqlite`, and `mysql` database driver libraries can be activated with their respective feature flags.\nNote, Some drivers require their dev libraries (`postgresql`: `libpq-dev`, `sqlite`: `libsqlite3-dev`).\n[Self update](https://github.com/jaemk/self_update) functionality (updating to the latest GitHub release) is available behind the `update` feature.\nThe binary releases are built with all features.\n\n**Building from source (`crates.io`):**\n\n```shell\n# install without features\n# use cli commands for all db interaction\ncargo install migrant\n\n# install with `postgres`\ncargo install migrant --features postgres\n\n# install with `rusqlite`\ncargo install migrant --features sqlite\n\n# all\ncargo install migrant --features 'postgres sqlite mysql update'\n```\n\n### Simple Usage\n\n`migrant init [--type \u003cdatabase-type\u003e, --location \u003cproject-dir\u003e, --no-confirm]` - Initialize project by creating a `Migrant.toml` file with db info/credentials.\nWhen run interactively (without `--no-confirm`), `setup` will be run automatically.\n\n`migrant setup` - Verify database info/credentials and setup a `__migrant_migrations` table if missing.\n\n`migrant new \u003ctag\u003e` - Generate new up \u0026 down files with the given `\u003ctag\u003e` under the specified `migration_location`.\n\n`migrant edit \u003ctag\u003e [--down]` - Edit the `up` [or `down`] migration file with the given `\u003ctag\u003e`.\n\n`migrant list` - Display all available .sql files and mark those applied.\n\n`migrant apply [--down, --all, --force, --fake]` - Apply the next available migration[s].\n\n`migrant shell` - Open a repl\n\n`migrant which-config` - Display the full path of the `Migrant.toml` file being used\n\n`migrant connect-string` - Display either the connection-string generated from config-params or the database-path for sqlite\n\n`migrant self update` - Update to the latest version released on GitHub.\n\n`migrant self bash-completions install [--path \u003cpath\u003e]` - Generate a bash completion script and save it to the default or specified path.\n\n\n### Usage as a library\n\nSee [`migrant_lib`](https://github.com/jaemk/migrant_lib) and\n[examples](https://github.com/jaemk/migrant_lib/tree/master/examples).\n`migrant` itself is just a thin wrapper around `migrant_lib`, so the full functionality of migration management\ncan be embedded in your actual project.\n\n\n### Development\n\nSee [CONTRIBUTING](https://github.com/jaemk/migrant/blob/master/CONTRIBUTING.md)\n\n\n### Docker\n\nAn image with the binary installed is available at `jaemk/migrant:latest` \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaemk%2Fmigrant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaemk%2Fmigrant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaemk%2Fmigrant/lists"}