MorningPeak/db/migrate/20150725193246_create_comments.rb
Arthur Poulet 7646e982d3 fix comment, implementation
- creator polymorphic instead of user
- implementation
2015-07-25 22:30:19 +02:00

18 lines
505 B
Ruby

class CreateComments < ActiveRecord::Migration
def self.up
create_table :comments do |t|
t.string :title, :limit => 50, :default => ""
t.text :comment
t.references :commentable, :polymorphic => true, :index => true
t.references :creator, :polymorphic => true, :index => true
t.string :role, :default => "comments", :index => true
t.timestamps
end
end
def self.down
drop_table :comments
end
end