20120101000070_create_channel.rb 771 B

12345678910111213141516171819202122
  1. class CreateChannel < ActiveRecord::Migration
  2. def up
  3. create_table :channels do |t|
  4. t.references :group, :null => true
  5. t.column :adapter, :string, :limit => 100, :null => false
  6. t.column :area, :string, :limit => 100, :null => false
  7. t.column :options, :string, :limit => 2000, :null => true
  8. t.column :active, :boolean, :null => false, :default => true
  9. t.column :updated_by_id, :integer, :null => false
  10. t.column :created_by_id, :integer, :null => false
  11. t.timestamps
  12. end
  13. add_index :channels, [:area]
  14. add_index :channels, [:adapter]
  15. end
  16. def down
  17. drop_table :channels
  18. end
  19. end