Permalink
Browse files

Added migrations support and an initial migration.

  • Loading branch information...
francois committed Oct 17, 2008
1 parent a8b76d8 commit 5e685c506e87378450ed34e6e54d6a8b31224f82
Showing with 21 additions and 0 deletions.
  1. +13 −0 db/migrate/articles.rb
  2. +8 −0 lib/tasks/migrations.rake
View
@@ -0,0 +1,13 @@
+migration 1, :create_articles do
+ up do
+ create_table :articles do
+ column :id, Integer, :serial => true, :nullable? => false
+ column :title, String
+ column :body, "TEXT"
+ end
+ end
+
+ down do
+ drop_table :articles
+ end
+end
@@ -0,0 +1,8 @@
+namespace :dm do
+ task :migrate => :environment do
+ gem "dm-migrations", "=0.9.6"
+ require "migration_runner"
+ Dir[File.join(Rails.root, "db", "migrate", "*")].each {|f| require f}
+ migrate_up!
+ end
+end

0 comments on commit 5e685c5

Please sign in to comment.