You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

010_create_comments.rb 529B

12345678910111213141516
  1. class CreateComments < ActiveRecord::Migration[4.2]
  2. def self.up
  3. create_table :comments do |t|
  4. t.column :commented_type, :string, :limit => 30, :default => "", :null => false
  5. t.column :commented_id, :integer, :default => 0, :null => false
  6. t.column :author_id, :integer, :default => 0, :null => false
  7. t.column :comments, :text
  8. t.column :created_on, :datetime, :null => false
  9. t.column :updated_on, :datetime, :null => false
  10. end
  11. end
  12. def self.down
  13. drop_table :comments
  14. end
  15. end