{"id":18544435,"url":"https://github.com/instructure/outrigger","last_synced_at":"2025-04-04T14:07:49.183Z","repository":{"id":56887127,"uuid":"41432597","full_name":"instructure/outrigger","owner":"instructure","description":"tag your migrations","archived":false,"fork":false,"pushed_at":"2025-02-18T18:26:02.000Z","size":66,"stargazers_count":37,"open_issues_count":3,"forks_count":13,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-28T13:09:01.508Z","etag":null,"topics":["gerrit-mirror"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/instructure.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-26T15:10:07.000Z","updated_at":"2025-02-18T18:26:08.000Z","dependencies_parsed_at":"2024-06-19T13:20:13.441Z","dependency_job_id":"d29010e6-be50-4db9-9e87-27d31c53116b","html_url":"https://github.com/instructure/outrigger","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Foutrigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Foutrigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Foutrigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Foutrigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instructure","download_url":"https://codeload.github.com/instructure/outrigger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190250,"owners_count":20898702,"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":["gerrit-mirror"],"created_at":"2024-11-06T20:16:32.370Z","updated_at":"2025-04-04T14:07:49.168Z","avatar_url":"https://github.com/instructure.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Outrigger\n==========\n\n[![Build Status](https://travis-ci.org/instructure/outrigger.svg?branch=master)](https://travis-ci.org/instructure/outrigger)\n\n### Tag your rails migrations\n\nOutrigger allows you to tag your migrations so that you can have\ncomplete control. This is especially useful for zero downtime deploys to Production environments.\n\nUsage\n------------\n\n1. Add `gem outrigger` to your Gemfile and run `bundle install`\n2. Tag migrations like so.\n```ruby\n  class PreDeployMigration \u003c ActiveRecord::Migration\n    tag :predeploy\n  end\n  class PostDeployMigration \u003c ActiveRecord::Migration\n    tag :super_fun\n  end\n```\n3. Run only the migrations you want.\n``` rake db:migrate:tagged[predeploy] ```\nor\n``` rake db:migrate:tagged[super_fun] ```\n4. If you need to ensure migrations run in a certain order with regular\n   `db:migrate`, set up `Outrigger.ordered`. It can be a hash or a proc that\n   takes a tag; either way it needs to return a sortable value:\n```ruby\nOutrigger.ordered = { predeploy: -1, postdeploy: 1 }\n```\n   This will run predeploys, untagged migrations (implicitly 0), and then\n   postdeploy migrations. Migrations with multiple tags will be looked up\n   by their first tag.\n\n### Using with [Switchman](https://github.com/instructure/switchman)\n\nIf your application is also using Switchman to manage multiple shards, you'll\nwant the `rake db:migrate:tagged` task to run against all shards, not\njust the default shard. To do this, add to a rake task file such as\n`lib/tasks/myapp.rake`:\n\n```ruby\nSwitchman::Rake.shardify_task('db:migrate:tagged')\n```\n\nMultiple Tags\n-------------\n\nPassing multiple tags to `db:migrate:tagged` means only run migrations that have\nall of the given tags.\n\n``` rake db:migrate:tagged[predeploy, dynamodb] ``` means run only migrations\ntagged with both `predeploy` and `dynamodb`. It will not run migrations tagged\njust `predeploy`.\n\nRuboCop Linter\n--------------\n\nOutrigger comes with a custom RuboCop linter that you can add to your project,\nto verify that all migrations have at least one valid tag.\n\nPut this into your `.rubocop.yml`.\n\n```yaml\nrequire:\n  - outrigger/cops/migration/tagged\n\nMigration/Tagged:\n  Enabled: true\n  AllowedTags:\n    - predeploy\n    - postdeploy\n```\n\nModify `AllowedTags` as necessary.\n\n### RuboCop Conflicts\n\nIf you use `rubocop-rails` and have the `Rails/ContentTag` cop enabled, you may\nsee rubocop errors like the following on your migrations:\n```\nRails/ContentTag: Use tag.predeploy instead of tag(:predeploy).\n  tag :predeploy\n  ^^^^^^^^^^^^^^\n```\n\nThis warning is erroneous, as the rails `tag` method is really only relevant in\ncontrollers and views and is not even in scope for migrations.  To silence the\nwarning, add the following to your `.rubocop.yml`:\n\n```yaml\nRails/ContentTag:\n  Exclude:\n    - \"**/db/migrate/*\" # this cop is for views, not migrations, where it gets confused with outrigger\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Foutrigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstructure%2Foutrigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Foutrigger/lists"}