{"id":29094209,"url":"https://github.com/wetransfer/ghost_adapter","last_synced_at":"2025-06-28T09:10:48.410Z","repository":{"id":42627590,"uuid":"333980120","full_name":"WeTransfer/ghost_adapter","owner":"WeTransfer","description":"Run ActiveRecord migrations through gh-ost","archived":false,"fork":false,"pushed_at":"2024-12-11T14:36:50.000Z","size":193,"stargazers_count":20,"open_issues_count":6,"forks_count":2,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-06-25T00:49:38.699Z","etag":null,"topics":["activerecord","gh-ost","ghost","mysql","rails","ruby","wt-branch-protection-default"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WeTransfer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-28T23:08:58.000Z","updated_at":"2024-12-11T14:38:20.000Z","dependencies_parsed_at":"2024-04-24T16:05:16.902Z","dependency_job_id":null,"html_url":"https://github.com/WeTransfer/ghost_adapter","commit_stats":{"total_commits":68,"total_committers":7,"mean_commits":9.714285714285714,"dds":0.4117647058823529,"last_synced_commit":"8c5b233384c229a78f3455afce3dc43da797ca3d"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/WeTransfer/ghost_adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WeTransfer%2Fghost_adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WeTransfer%2Fghost_adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WeTransfer%2Fghost_adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WeTransfer%2Fghost_adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WeTransfer","download_url":"https://codeload.github.com/WeTransfer/ghost_adapter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WeTransfer%2Fghost_adapter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262403828,"owners_count":23305692,"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":["activerecord","gh-ost","ghost","mysql","rails","ruby","wt-branch-protection-default"],"created_at":"2025-06-28T09:10:47.719Z","updated_at":"2025-06-28T09:10:48.401Z","avatar_url":"https://github.com/WeTransfer.png","language":"Ruby","readme":"# Ghost Adapter\n\n![ghost](./doc/images/ghost.png)\n\n[![Gem](https://img.shields.io/gem/v/ghost_adapter)](https://rubygems.org/gems/ghost_adapter)\n![GitHub Actions Workflow](https://github.com/WeTransfer/ghost_adapter/actions/workflows/tests.yml/badge.svg)\n[![Hippocratic License](https://img.shields.io/badge/license-Hippocratic-green)](https://github.com/WeTransfer/ghost_adapter/blob/main/LICENSE.md)\n[![gh-ost version](https://img.shields.io/badge/gh--ost%20version-1.1.1-blue)](https://github.com/github/gh-ost/releases/latest)\n\nA tiny, _very configurable_ ActiveRecord adapter built for running [gh-ost](https://github.com/github/gh-ost) migrations. When not running migrations, it'll stay the heck out of the way.\n\n## Installation\n\nFirst, you'll need to install `gh-ost`. You can find the latest release [here](https://github.com/github/gh-ost/releases/latest). You can check the allowed version range in [the version checker](./lib/ghost_adapter/version_checker.rb#L13) (current range: [\u003e= 1.1.0, \u003c 2]). Once you've got that installed, install the gem!\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'ghost_adapter'\n```\n\nAnd then execute:\n\n    $ bundle install\n\n## Usage\n\n### Connect with ActiveRecord\n\nConfigure your ActiveRecord connection to use `mysql2_ghost` as the adapter in whichever environments you'd like to use `gh-ost`.\n\nFor a standard rails project, in `config/database.yml` set `adapter: mysql2_ghost`.\n\nFor usage with `DATABASE_URL`, only a _very tiny_ modification is necessary. The URL should be like: `mysql2-ghost://` (notice the `-` instead of `_`). This is because the scheme of a URI must be either alphanumeric or one of [`-`, `.`, `+`] ([more details](https://tools.ietf.org/html/rfc3986#section-3.1))\n\n### Configuration\n\nYou can configure `ghost_adapter` with (nearly) all of the arguments allowed `gh-ost` in the command line. The arguments are up to date as of `gh-ost` version 1.1.0.\n\nRead more about configuration methods in [the docs](./doc/configuration.md).\n\n### Running Migrations\n\nSince most database activity isn't a migration, we default to just using the `Mysql2Adapter`. No need to be executing a bunch of extra logic per query when you're only getting any value for migrations.\n\nTo enable the ghost adapter, you have two options. First (recommended) is to use the provided rails generator:\n\n```shell\nrails g ghost_adapter:install\n```\n\nThis does everything you need. All migrations will run through gh-ost and otherwise the adapter will be ignored.\n\nAlternatively, you can enable (or disable) gh-ost migrations with an environment variable.\n\n```shell\nGHOST_MIGRATE=1 rake db:...\n```\n\nIf you have used the rails generator, you can set the variable to a falsey value and it will override the behavior not to use gh-ost.\n\n- \"truthy\" values: `[1, t, true, y, yes]`\n- \"falsey\" values: `[0, f, false, n, no]`\n\n### Running tests\n\nTo run the tests for all versions, run this script:\n\n```shell\nbin/test_all_versions\n```\n\nMake sure to use the appropriate Ruby version! ActiveRecord \u003c6.0 is not compatible with Ruby 3, so specs for those versions will only run successfully in a Ruby 2 environment.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/wetransfer/ghost_adapter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](./CODE_OF_CONDUCT.md).\nPlease add your name to the [CONTRIBUTORS.md](./CONTRIBUTORS.md)\n\n## Releasing\n\n### Updating version\n\nBefore releasing, make sure the version is updated appropriately. This can be done with:\n\n```shell\nbundle exec bump [major|minor|patch]\n```\n\nYou should (at least roughly) follow [semver rules](https://semver.org/) for version updates.\n\n### Publishing\n\nUpon each version update, the new gem should be published to rubygems.org. This can be done with:\n\n```shell\nbundle exec rake release\n```\n\nThis will ask you to authenticate to rubygems.org. If you have need credentials, please reach out to one of the [contributors](./CONTRIBUTORS.md)\n\n## License\n\nThe gem is available as open source under the terms of the [Hippocratic License](https://firstdonoharm.dev/version/2/1/license.html).\n\n## Code of Conduct\n\nEveryone interacting in the Ghost Adapter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](./CODE_OF_CONDUCT.md).\n\n---\n\nIllustration by \u003ca href=\"undefined\"\u003eIcons 8\u003c/a\u003e from \u003ca href=\"https://icons8.com/\"\u003eIcons8\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwetransfer%2Fghost_adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwetransfer%2Fghost_adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwetransfer%2Fghost_adapter/lists"}