Skip to content

Commit

Permalink
acts-as-list-migrate
Browse files Browse the repository at this point in the history
The migration generator knows about `acts_as_list`, so you can just
run it and you'll get the new position column on Task.

    $ hobo generate migration

And that's it!
  • Loading branch information
bryanlarsen authored and iox committed Aug 12, 2013
1 parent 91eb4a3 commit 20fb86d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions db/migrate/20130109024936_install_acts_as_list.rb
@@ -0,0 +1,9 @@
class InstallActsAsList < ActiveRecord::Migration
def self.up
add_column :tasks, :position, :integer
end

def self.down
remove_column :tasks, :position
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20130109022053) do
ActiveRecord::Schema.define(:version => 20130109024936) do

create_table "projects", :force => true do |t|
t.string "name"
Expand Down Expand Up @@ -54,6 +54,7 @@
t.datetime "created_at"
t.datetime "updated_at"
t.integer "story_id"
t.integer "position"
end

add_index "tasks", ["story_id"], :name => "index_tasks_on_story_id"
Expand Down

0 comments on commit 20fb86d

Please sign in to comment.