Skip to content

Commit

Permalink
Added migrations support and an initial migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
francois committed Oct 17, 2008
1 parent a8b76d8 commit 5e685c5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions db/migrate/articles.rb
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions lib/tasks/migrations.rake
Original file line number Diff line number Diff line change
@@ -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.