Class: CreateChats
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateChats
- Defined in:
- lib/rails/generators/chatter/templates/create_chats.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
13 14 15 |
# File 'lib/rails/generators/chatter/templates/create_chats.rb', line 13 def self.down drop_table :chats end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/rails/generators/chatter/templates/create_chats.rb', line 2 def self.up create_table :chats do |t| t.string :from, :limit => 255, :null => false, :default => '' t.string :to, :limit => 255, :null => false, :default => '' t.text :message, :null => false t. :sent, :null => false, :dafault => '0000-00-00 00:00:00' t.integer :recd, :null => false, :default => 0 end add_index :chats, :from add_index :chats, :to end |