github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

joshsusser / migration_concordance

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 15
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • for_2_1
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Ruby on Rails plugin to provide notification when you need to run migrations — Read more

  cancel

http://blog.hasmanythrough.com/2008/3/2/migration-concordance

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

remove dependency on regreen gem (and thus test/unit) 
joshsusser (author)
Thu Jul 10 09:13:13 -0700 2008
commit  547a21bc3e665dd740e1ce746e12ed8d36896e88
tree    8ae13d7d490727d024cb1cd6fe96df50d4063d51
parent  c30cebe19ee9fd63f4b5396abe6ec1ad1a366f3b
migration_concordance /
name age
history
message
file MIT-LICENSE Loading commit data...
file README
file init.rb
file install.rb
directory lib/
file uninstall.rb
README
MigrationConcordance
====================

by Josh Susser <josh@hasmanythrough.com>

project page: http://github.com/joshsusser/migration_concordance
project repo: git://github.com/joshsusser/migration_concordance.git

This plugin extends Rails migrations to provide notification when you need to run migrations. It
will detect both new migrations and modifications to previously run migrations. It is primarily of
use for team development, but is also useful when deploying a release to a new environment to
determine when migrations need to be run. This plugin does not run migrations automatically, but
will notify you whenever you need to run them.

To integrate with your application:

1) Add the following line to the end of your config/environment.rb file:

    puts ActiveRecord::Migrator.check_concordance

2) Add the file db/migration_snapshot.yml to your SCM ignore list (for example, the svn:ignore
property or .gitignore file). Putting the snapshot file under version control defeats the whole
purpose of this feature.

Any time you load your application's environment, it will indicate whether you need to run
migrations to bring your schema into concordance with the migration files. This notification will
happen when you run script/server, tests, the console, or any rake task that depends on the
environment. If you want to check on migration status, you can run "rake environment" to print the
notification.

Background
==========

MigrationConcordance works by taking a snapshot of the state of an appliation's migrations every
time you run "rake db:migrate". It creates a file in db/migration_snapshot.yml that holds a list
of all current migrations and their MD5 hashes. Therefore, if you migrate to a migration that is
not the latest (using rake db:migrate VERSION=<version>), you won't get any more notifications
even if you aren't on the latest version. It assumes you know what you are doing and won't keep
nagging you to migrate after you've migrated somewhere already.

Copyright (c) 2008 Josh Susser, released under the MIT license
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server