cs_app/db/migrate/1050_create_comments.rb
Nicolas Bally 8a08ee35c8 initial
2015-02-22 14:36:30 +01:00

23 lines
501 B
Ruby

class CreateComments < ActiveRecord::Migration
def self.up
create_table :comments do |t|
t.string :pseudo, :default => ""
t.string :email, :default => ""
t.string :website, :default => ""
t.boolean :enabled
t.text :comment
t.references :commentable, :polymorphic => true
t.references :user
t.timestamps
end
add_index :comments, :commentable_type
add_index :comments, :commentable_id
end
def self.down
drop_table :comments
end
end