{"id":15319062,"url":"https://github.com/appleboy/mgo-migrate","last_synced_at":"2026-05-18T10:31:18.043Z","repository":{"id":66187515,"uuid":"141896520","full_name":"appleboy/mgo-migrate","owner":"appleboy","description":"Migrate function of MongoDB driver for Go","archived":false,"fork":false,"pushed_at":"2018-08-15T06:40:26.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T05:49:32.810Z","etag":null,"topics":["mgo","mgo2","migrate","mongodb"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/appleboy.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,"governance":null}},"created_at":"2018-07-22T13:07:40.000Z","updated_at":"2018-10-18T06:15:24.000Z","dependencies_parsed_at":"2023-02-21T17:00:32.920Z","dependency_job_id":null,"html_url":"https://github.com/appleboy/mgo-migrate","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"63ab506a9f84a92cb2684fcef8b51bd6f53f723a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/appleboy/mgo-migrate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fmgo-migrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fmgo-migrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fmgo-migrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fmgo-migrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleboy","download_url":"https://codeload.github.com/appleboy/mgo-migrate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fmgo-migrate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33174601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["mgo","mgo2","migrate","mongodb"],"created_at":"2024-10-01T09:03:23.606Z","updated_at":"2026-05-18T10:31:18.021Z","avatar_url":"https://github.com/appleboy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mgo-migrate\n\n[![GoDoc](https://godoc.org/github.com/appleboy/mgo-migrate?status.svg)](https://godoc.org/github.com/appleboy/mgo-migrate)\n[![Build Status](http://drone.wu-boy.com/api/badges/appleboy/mgo-migrate/status.svg)](http://drone.wu-boy.com/appleboy/mgo-migrate)\n[![codecov](https://codecov.io/gh/appleboy/mgo-migrate/branch/master/graph/badge.svg)](https://codecov.io/gh/appleboy/mgo-migrate)\n[![Go Report Card](https://goreportcard.com/badge/github.com/appleboy/mgo-migrate)](https://goreportcard.com/report/github.com/appleboy/mgo-migrate)\n\nMigrate function of MongoDB driver for Go\n\n## How to use\n\n```go\npackage main\n\nimport (\n\t\"github.com/appleboy/mgo-migrate\"\n\t\"gopkg.in/mgo.v2\"\n)\n\nfunc main() {\n\tsession, err := mgo.Dial(\"127.0.0.1\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tm := migrate.New(session, \"test_db\", migrate.DefaultOptions, []*migrate.Migration{{\n\t\tID: \"201709201400\",\n\t\tMigrate: func(s *mgo.Session) error {\n\t\t\treturn nil\n\t\t},\n\t\tRollback: func(s *mgo.Session) error {\n\t\t\treturn nil\n\t\t},\n\t}})\n\n\tif err := m.Migrate(); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := m.RollbackLast(); err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fmgo-migrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleboy%2Fmgo-migrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fmgo-migrate/lists"}