Code Monkey home page Code Monkey logo

migration_concordance's Introduction

MigrationConcordance
====================

by Josh Susser <[email protected]>

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

migration_concordance's People

Contributors

joshsusser avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.