您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

039_create_watchers.rb 342B

12345678910111213
  1. class CreateWatchers < ActiveRecord::Migration[4.2]
  2. def self.up
  3. create_table :watchers do |t|
  4. t.column :watchable_type, :string, :default => "", :null => false
  5. t.column :watchable_id, :integer, :default => 0, :null => false
  6. t.column :user_id, :integer
  7. end
  8. end
  9. def self.down
  10. drop_table :watchers
  11. end
  12. end