{"id":46739348,"url":"https://github.com/johngibb/migrate","last_synced_at":"2026-03-09T17:17:45.567Z","repository":{"id":29699095,"uuid":"116171964","full_name":"johngibb/migrate","owner":"johngibb","description":"Exceedingly simple Postgres migration tool","archived":false,"fork":false,"pushed_at":"2025-08-10T04:16:18.000Z","size":292,"stargazers_count":18,"open_issues_count":5,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T11:00:04.505Z","etag":null,"topics":["golang","migration","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johngibb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-03T19:05:47.000Z","updated_at":"2025-08-10T04:17:21.000Z","dependencies_parsed_at":"2022-08-07T14:30:38.461Z","dependency_job_id":null,"html_url":"https://github.com/johngibb/migrate","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/johngibb/migrate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johngibb%2Fmigrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johngibb%2Fmigrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johngibb%2Fmigrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johngibb%2Fmigrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johngibb","download_url":"https://codeload.github.com/johngibb/migrate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johngibb%2Fmigrate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30304177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T14:33:48.460Z","status":"ssl_error","status_checked_at":"2026-03-09T14:33:48.027Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","migration","postgresql"],"created_at":"2026-03-09T17:17:44.809Z","updated_at":"2026-03-09T17:17:45.554Z","avatar_url":"https://github.com/johngibb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/johngibb/migrate.svg?branch=master)](https://travis-ci.org/johngibb/migrate)\n[![GoDoc](https://godoc.org/github.com/johngibb/migrate?status.svg)](https://godoc.org/github.com/johngibb/migrate)\n\n# migrate\n\nMigrate is an exceedingly simple Postgres database migration tool.\n\nThe simplicity is manifested in the following principles:\n\n* There are no \"down\" migrations. Because migrations necessarily mutate\n  state on a live server, [you can't have a safe rollback button](https://mcfunley.com/page/3/).\n* Migrations are *not* automatically executed within a transaction.\n  Transactions are expensive, often unnecessary, and prevent certain\n  operations (e.g. `create index concurrently`). If the migration\n  warrants transactional semantics, simply include `begin; ... ;\n  commit;` within the source of your migration.\n* Migrations are not skipped if they are added out of order with regard\n  to their version number, unlike [some alternative tools](https://github.com/mattes/migrate/issues/237).\n  This handles the case where a migration is added in a feature branch,\n  and no longer has the highest version number when merged into master.\n\n## Install\n\n```\n$ go get -u github.com/johngibb/migrate/cmd/migrate\n```\n\nThis will install `migrate` to your $GOPATH/bin directory.\n\n## Usage\n\nCreate a migration:\n\n```\n$ migrate create -src \u003cfolder\u003e \u003cmigration name\u003e:\n    Creates a new migration file.\n  -src string\n      directory containing migration files (default \".\")\n```\n\nView pending and applied migrations:\n\n```\n$ migrate status:\n    Display a list of pending and applied migrations.\n  -conn string\n      postgres connection string\n  -src string\n      directory containing migration files (default \".\")\n```\n\nApply pending migrations:\n\n```\n$ migrate up -src \u003cmigrations folder\u003e -conn \u003cconnection string\u003e [-quiet]:\n    Apply all pending migrations.\n  -conn string\n      postgres connection string\n  -quiet\n      only print errors\n  -src string\n      directory containing migration files (default \".\")\n```\n\n## Migrations\n\nMigrations are written as plain SQL scripts. All statements should be\nterminated with a semicolon, as `migrate` will execute the script one\nstatement at a time.\n\nA simple migration to add a users table might look like:\n\n```sql\ncreate table users (id int, name text);\n```\n\nA more complicated migration that uses a transaction to create multiple\ntables and build an index might look like:\n\n```sql\nbegin;\ncreate table users (id int, name text);\ncreate table groups (id int, name text);\ncreate table users_groups (user_id int, group_id int);\ncommit;\ncreate index concurrently on users (id);\n```\n\n# Development\n\nTo run the full integration tests, you'll need to have\n[Docker for Mac](https://www.docker.com/docker-mac) installed.\n\n```\nmake install  // compiles the entire project\nmake test     // runs the unit tests on your host machine\nmake test-all // compiles and runs all tests (including integration\n              // tests against a Postgres instance) using Docker\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohngibb%2Fmigrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohngibb%2Fmigrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohngibb%2Fmigrate/lists"}