Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fill readme with what is coming...

  • Loading branch information...
commit dec36de8c98e4d9d93a5d0b643e4e8e65aed086d 1 parent 66dc7a8
@grosser grosser authored
Showing with 62 additions and 62 deletions.
  1. +0 −62 README
  2. +62 −0 README.markdown
View
62 README
@@ -1,62 +0,0 @@
-STANDALONE MIGRATIONS
----------------------
-This project allows you to use Rails migrations in non-Rails (and non Ruby) projects. I created it because not all of my projects are on Rails but I still think Rails migrations are the best way to manage a database schema. For this code to work you need Ruby, Gems, ActiveRecord, Rake and a suitable database driver installed.
-
-Email me at todd dot huss dot work at gmail dot com if you have a patch that adds functionality or fixes a bug. Or post a comment here:
-http://gabrito.com/post/standalone-migrations-using-rails-migrations-in-non-rails-projects
-
-TODO
-----
-Turn into a gem
-
-USAGE
------
-To create a new database migration run:
-
-rake db:new_migration name=FooBarMigration
-edit migrations/20081220234130_foo_bar_migration.rb
-
-and fill in the up and down migrations. To apply your newest migration
-
-rake db:migrate
-
-To migrate to a specific version (for example to rollback)
-
-rake db:migrate VERSION=20081220234130
-
-To migrate a specific database (for example your "testing" database)
-
-rake db:migrate RAILS_ENV=test
-
-CREDIT
-------
-This work is based on Lincoln Stoll's blog post: http://lstoll.net/2008/04/stand-alone-activerecord-migrations/
-and David Welton's post http://journal.dedasys.com/2007/01/28/using-migrations-outside-of-rails
-
-INSTALLATION
-------------
-Many systems have pre-existing packages for Ruby and Ruby gems so in most cases that should be pretty straightforward. Once Ruby and Gem is installed, as root run:
-gem install -y activerecord rake mysql
-
-cd standalone-migrations/config
-cp database_sample.yml database.yml
-edit database.yml (and change settings for your database, the development database is the default)
-cd ../
-rake db:migrate (this will just create the schema_migrations table)
-(If you're familiar with rails there are also the tasks db:schema:dump and db:schema:load)
-
-DOCUMENTATION
--------------
-A good source to learn how to use migrations is:
-http://dizzy.co.uk/ruby_on_rails/cheatsheets/rails-migrations
-or if you're lazy and want to just execute raw SQL
-
-def self.up
- execute "insert into foo values (123,'something');"
-end
-
-def self.down
- execute "delete from foo where field='something';"
-end
-
-
View
62 README.markdown
@@ -0,0 +1,62 @@
+Rails migrations in non-Rails (and non Ruby) projects.
+For this code to work you need Ruby, Gems, ActiveRecord, Rake and a suitable database driver installed.
+
+USAGE
+=====
+Install Ruby, RubyGems then:
+ sudo gem install standalone_migrations
+
+Add to `Rakefile` in your projects base directory:
+ require 'rubygems'
+ require 'standalone_migrations'
+ StandaloneMigrations.tasks
+
+Add database configuration to `config/database.yml` in your projects base directory e.g.:
+ development:
+ adapter: mysql
+ encoding: utf8
+ reconnect: false
+ database: somedatabase_dev
+ pool: 5
+ username: root
+ password:
+ socket: /var/run/mysqld/mysqld.sock
+
+ test:
+ ...something similar...
+
+To create a new database migration run:
+
+ rake db:new_migration name=FooBarMigration
+ edit migrations/20081220234130_foo_bar_migration.rb
+
+and fill in the up and down migrations. To apply your newest migration
+
+ rake db:migrate
+
+To migrate to a specific version (for example to rollback)
+
+ rake db:migrate VERSION=20081220234130
+
+To migrate a specific database (for example your "testing" database)
+
+ rake db:migrate RAILS_ENV=test
+
+CREDIT
+======
+This work is based on Lincoln Stoll's blog post: http://lstoll.net/2008/04/stand-alone-activerecord-migrations/
+and David Welton's post http://journal.dedasys.com/2007/01/28/using-migrations-outside-of-rails
+
+FURTHER HELP
+============
+A good source to learn how to use migrations is:
+http://dizzy.co.uk/ruby_on_rails/cheatsheets/rails-migrations
+or if you're lazy and want to just execute raw SQL
+
+ def self.up
+ execute "insert into foo values (123,'something');"
+ end
+
+ def self.down
+ execute "delete from foo where field='something';"
+ end
Please sign in to comment.
Something went wrong with that request. Please try again.