Giter Club home page Giter Club logo

migrate_war's Introduction

MigrateWar
==========

Simple Rails plugin to enable migrations to be run just after the rails application loads by using the
ServletContext in a JRuby/Goldspike environment.  This simulates the capistrano deploy and migrate workflow.

Consists of a ServletContextListener which executes a migration when the context (i.e. the rails application) loads.

SVN repository is at
http://svn.silverchairsolutions.com/migrate_war

Author:   Mike Hagedorn  ([email protected])

Installing the ContextListener
------------------------------
add the following to your web.xml.  This will pull your code into the war file and make it execute on load
  


  <listener>
    <listener-class>org.jruby.webapp.MigratorContextListener</listener-class>
  </listener>


	<context-param>
		<param-name>command-file</param-name>
		<param-value>migrator.rb</param-value>
		<description>Run this file to execute an initial migration (for deployment to new platforms)</description>
	</context-param>


Note that this will apply the schema to the production database, blowing away the previous contents, so back up your data before redeploying.  If you what to disable the schema.rb stuff, you can either a) remove the listener definition from the web.xml or b) comment out the load comment in the migrator.rb file.

Alternatively, you could expand the migrator.rb logic and import data from fixtures or something
        




Copyright (c) 2008 Mike Hagedorn, http://www.silverchairsolutions.com, released under the MIT license

migrate_war's People

Stargazers

Angus H. avatar Mike Hagedorn avatar

Watchers

Mike Hagedorn avatar  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.