[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4833":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":45,"readmeContent":46,"aiSummary":47,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":48,"discoverSource":49},4833,"migrate","golang-migrate\u002Fmigrate","golang-migrate","Database migrations. CLI and Golang library.","",null,"Go",18597,1588,82,306,0,2,29,121,15,44.6,"Other",false,"master",[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],"aws-s3","cassandra","database","databases","go","golang","google-cloud-spanner","google-cloud-storage","hacktoberfest","mariadb","migration","migrations","mongodb","mysql","neo4j","postgres","spanner","sql","sqlite","2026-06-12 02:01:04","[![GitHub Workflow Status (branch)](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fgolang-migrate\u002Fmigrate\u002Fci.yaml?branch=master)](https:\u002F\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate\u002Factions\u002Fworkflows\u002Fci.yaml?query=branch%3Amaster)\n[![GoDoc](https:\u002F\u002Fpkg.go.dev\u002Fbadge\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate)](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4)\n[![Coverage Status](https:\u002F\u002Fimg.shields.io\u002Fcoveralls\u002Fgithub\u002Fgolang-migrate\u002Fmigrate\u002Fmaster.svg)](https:\u002F\u002Fcoveralls.io\u002Fgithub\u002Fgolang-migrate\u002Fmigrate?branch=master)\n[![packagecloud.io](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdeb-packagecloud.io-844fec.svg)](https:\u002F\u002Fpackagecloud.io\u002Fgolang-migrate\u002Fmigrate?filter=debs)\n[![Docker Pulls](https:\u002F\u002Fimg.shields.io\u002Fdocker\u002Fpulls\u002Fmigrate\u002Fmigrate.svg)](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fmigrate\u002Fmigrate\u002F)\n![Supported Go Versions](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGo-1.24%2C%201.25-lightgrey.svg)\n[![GitHub Release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frelease\u002Fgolang-migrate\u002Fmigrate.svg)](https:\u002F\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate\u002Freleases)\n[![Go Report Card](https:\u002F\u002Fgoreportcard.com\u002Fbadge\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4)](https:\u002F\u002Fgoreportcard.com\u002Freport\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4)\n\n# migrate\n\n__Database migrations written in Go. Use as [CLI](#cli-usage) or import as [library](#use-in-your-go-project).__\n\n* Migrate reads migrations from [sources](#migration-sources)\n   and applies them in correct order to a [database](#databases).\n* Drivers are \"dumb\", migrate glues everything together and makes sure the logic is bulletproof.\n   (Keeps the drivers lightweight, too.)\n* Database drivers don't assume things or try to correct user input. When in doubt, fail.\n\nForked from [mattes\u002Fmigrate](https:\u002F\u002Fgithub.com\u002Fmattes\u002Fmigrate)\n\n## Databases\n\nDatabase drivers run migrations. [Add a new database?](database\u002Fdriver.go)\n\n* [PostgreSQL](database\u002Fpostgres)\n* [PGX v4](database\u002Fpgx)\n* [PGX v5](database\u002Fpgx\u002Fv5)\n* [Redshift](database\u002Fredshift)\n* [Ql](database\u002Fql)\n* [Cassandra \u002F ScyllaDB](database\u002Fcassandra)\n* [SQLite](database\u002Fsqlite)\n* [SQLite3](database\u002Fsqlite3) ([todo #165](https:\u002F\u002Fgithub.com\u002Fmattes\u002Fmigrate\u002Fissues\u002F165))\n* [SQLCipher](database\u002Fsqlcipher)\n* [MySQL \u002F MariaDB](database\u002Fmysql)\n* [Neo4j](database\u002Fneo4j)\n* [MongoDB](database\u002Fmongodb)\n* [CrateDB](database\u002Fcrate) ([todo #170](https:\u002F\u002Fgithub.com\u002Fmattes\u002Fmigrate\u002Fissues\u002F170))\n* [Shell](database\u002Fshell) ([todo #171](https:\u002F\u002Fgithub.com\u002Fmattes\u002Fmigrate\u002Fissues\u002F171))\n* [Google Cloud Spanner](database\u002Fspanner)\n* [CockroachDB](database\u002Fcockroachdb)\n* [YugabyteDB](database\u002Fyugabytedb)\n* [ClickHouse](database\u002Fclickhouse)\n* [Firebird](database\u002Ffirebird)\n* [MS SQL Server](database\u002Fsqlserver)\n* [rqlite](database\u002Frqlite)\n\n### Database URLs\n\nDatabase connection strings are specified via URLs. The URL format is driver dependent but generally has the form: `dbdriver:\u002F\u002Fusername:password@host:port\u002Fdbname?param1=true&param2=false`\n\nAny [reserved URL characters](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FPercent-encoding#Percent-encoding_reserved_characters) need to be escaped. Note, the `%` character also [needs to be escaped](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FPercent-encoding#Percent-encoding_the_percent_character)\n\nExplicitly, the following characters need to be escaped:\n`!`, `#`, `$`, `%`, `&`, `'`, `(`, `)`, `*`, `+`, `,`, `\u002F`, `:`, `;`, `=`, `?`, `@`, `[`, `]`\n\nIt's easiest to always run the URL parts of your DB connection URL (e.g. username, password, etc) through an URL encoder. See the example Python snippets below:\n\n```bash\n$ python3 -c 'import urllib.parse; print(urllib.parse.quote(input(\"String to encode: \"), \"\"))'\nString to encode: FAKEpassword!#$%&'()*+,\u002F:;=?@[]\nFAKEpassword%21%23%24%25%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D\n$ python2 -c 'import urllib; print urllib.quote(raw_input(\"String to encode: \"), \"\")'\nString to encode: FAKEpassword!#$%&'()*+,\u002F:;=?@[]\nFAKEpassword%21%23%24%25%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D\n$\n```\n\n## Migration Sources\n\nSource drivers read migrations from local or remote sources. [Add a new source?](source\u002Fdriver.go)\n\n* [Filesystem](source\u002Ffile) - read from filesystem\n* [io\u002Ffs](source\u002Fiofs) - read from a Go [io\u002Ffs](https:\u002F\u002Fpkg.go.dev\u002Fio\u002Ffs#FS)\n* [Go-Bindata](source\u002Fgo_bindata) - read from embedded binary data ([jteeuwen\u002Fgo-bindata](https:\u002F\u002Fgithub.com\u002Fjteeuwen\u002Fgo-bindata))\n* [pkger](source\u002Fpkger) - read from embedded binary data ([markbates\u002Fpkger](https:\u002F\u002Fgithub.com\u002Fmarkbates\u002Fpkger))\n* [GitHub](source\u002Fgithub) - read from remote GitHub repositories\n* [GitHub Enterprise](source\u002Fgithub_ee) - read from remote GitHub Enterprise repositories\n* [Bitbucket](source\u002Fbitbucket) - read from remote Bitbucket repositories\n* [Gitlab](source\u002Fgitlab) - read from remote Gitlab repositories\n* [AWS S3](source\u002Faws_s3) - read from Amazon Web Services S3\n* [Google Cloud Storage](source\u002Fgoogle_cloud_storage) - read from Google Cloud Platform Storage\n\n## CLI usage\n\n* Simple wrapper around this library.\n* Handles ctrl+c (SIGINT) gracefully.\n* No config search paths, no config files, no magic ENV var injections.\n\n[CLI Documentation](cmd\u002Fmigrate) (includes CLI install instructions)\n\n### Basic usage\n\n```bash\n$ migrate -source file:\u002F\u002Fpath\u002Fto\u002Fmigrations -database postgres:\u002F\u002Flocalhost:5432\u002Fdatabase up 2\n```\n\n### Docker usage\n\n```bash\n$ docker run -v {{ migration dir }}:\u002Fmigrations --network host migrate\u002Fmigrate\n    -path=\u002Fmigrations\u002F -database postgres:\u002F\u002Flocalhost:5432\u002Fdatabase up 2\n```\n\n## Use in your Go project\n\n* API is stable and frozen for this release (v3 & v4).\n* Uses [Go modules](https:\u002F\u002Fgolang.org\u002Fcmd\u002Fgo\u002F#hdr-Modules__module_versions__and_more) to manage dependencies.\n* To help prevent database corruptions, it supports graceful stops via `GracefulStop chan bool`.\n* Bring your own logger.\n* Uses `io.Reader` streams internally for low memory overhead.\n* Thread-safe and no goroutine leaks.\n\n__[Go Documentation](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4)__\n\n```go\nimport (\n    \"github.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4\"\n    _ \"github.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4\u002Fdatabase\u002Fpostgres\"\n    _ \"github.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4\u002Fsource\u002Fgithub\"\n)\n\nfunc main() {\n    m, err := migrate.New(\n        \"github:\u002F\u002Fmattes:personal-access-token@mattes\u002Fmigrate_test\",\n        \"postgres:\u002F\u002Flocalhost:5432\u002Fdatabase?sslmode=enable\")\n    m.Steps(2)\n}\n```\n\nWant to use an existing database client?\n\n```go\nimport (\n    \"database\u002Fsql\"\n    _ \"github.com\u002Flib\u002Fpq\"\n    \"github.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4\"\n    \"github.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4\u002Fdatabase\u002Fpostgres\"\n    _ \"github.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4\u002Fsource\u002Ffile\"\n)\n\nfunc main() {\n    db, err := sql.Open(\"postgres\", \"postgres:\u002F\u002Flocalhost:5432\u002Fdatabase?sslmode=enable\")\n    driver, err := postgres.WithInstance(db, &postgres.Config{})\n    m, err := migrate.NewWithDatabaseInstance(\n        \"file:\u002F\u002F\u002Fmigrations\",\n        \"postgres\", driver)\n    m.Up() \u002F\u002F or m.Steps(2) if you want to explicitly set the number of migrations to run\n}\n```\n\n## Getting started\n\nGo to [getting started](GETTING_STARTED.md)\n\n## Tutorials\n\n* [CockroachDB](database\u002Fcockroachdb\u002FTUTORIAL.md)\n* [PostgreSQL](database\u002Fpostgres\u002FTUTORIAL.md)\n\n(more tutorials to come)\n\n## Migration files\n\nEach migration has an up and down migration. [Why?](FAQ.md#why-two-separate-files-up-and-down-for-a-migration)\n\n```bash\n1481574547_create_users_table.up.sql\n1481574547_create_users_table.down.sql\n```\n\n[Best practices: How to write migrations.](MIGRATIONS.md)\n\n## Coming from another db migration tool?\n\nCheck out [migradaptor](https:\u002F\u002Fgithub.com\u002Fmusinit\u002Fmigradaptor\u002F).\n*Note: migradaptor is not affiliated or supported by this project*\n\n## Versions\n\nVersion | Supported? | Import | Notes\n--------|------------|--------|------\n**master** | :white_check_mark: | `import \"github.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4\"` | New features and bug fixes arrive here first |\n**v4** | :white_check_mark: | `import \"github.com\u002Fgolang-migrate\u002Fmigrate\u002Fv4\"` | Used for stable releases |\n**v3** | :x: | `import \"github.com\u002Fgolang-migrate\u002Fmigrate\"` (with package manager) or `import \"gopkg.in\u002Fgolang-migrate\u002Fmigrate.v3\"` (not recommended) | **DO NOT USE** - No longer supported |\n\n## Development and Contributing\n\nYes, please! [`Makefile`](Makefile) is your friend,\nread the [development guide](CONTRIBUTING.md).\n\nAlso have a look at the [FAQ](FAQ.md).\n\n---\n\nLooking for alternatives? [https:\u002F\u002Fawesome-go.com\u002F#database](https:\u002F\u002Fawesome-go.com\u002F#database).\n","golang-migrate\u002Fmigrate 是一个用于数据库迁移的工具，支持通过命令行界面（CLI）和 Go 语言库两种方式使用。它能够从多种源读取迁移脚本，并按正确顺序应用到指定的数据库中，支持包括 PostgreSQL、MySQL、MongoDB 在内的多种数据库类型。该项目采用轻量级驱动设计，确保逻辑严谨且易于维护。适用于需要进行数据库结构变更管理的各种开发场景，如版本控制下的数据库升级、数据迁移等任务，特别适合使用 Go 语言构建的应用程序。","2026-06-11 03:00:47","top_language"]