master
1class ActsAsCommentableWithThreadingMigration < ActiveRecord::Migration
2 def self.up
3 create_table :comments, :force => true do |t|
4 t.integer :commentable_id, :default => 0
5 t.string :commentable_type, :default => ""
6 t.string :title, :default => ""
7 t.text :body, :default => ""
8 t.string :subject, :default => ""
9 t.integer :user_id, :default => 0, :null => false
10 t.integer :parent_id, :lft, :rgt
11 t.timestamps
12 end
13
14 add_index :comments, :user_id
15 add_index :comments, :commentable_id
16 end
17
18 def self.down
19 drop_table :comments
20 end
21end