Class: CreateMessages
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateMessages
- Defined in:
- lib/generators/fetty/messages/templates/models/active_record/create_messages.rb
Class Method Summary collapse
Class Method Details
permalink .down ⇒ Object
[View source]
20 21 22 23 |
# File 'lib/generators/fetty/messages/templates/models/active_record/create_messages.rb', line 20 def self.down drop_index :messages, "messages_idx" drop_table :messages end |
permalink .up ⇒ Object
[View source]
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/generators/fetty/messages/templates/models/active_record/create_messages.rb', line 2 def self.up create_table :messages do |t| t.integer :user_id t.integer :sender_id t.integer :recipient_id t.integer :subject_id t.string :subject t.text :content t.boolean :opened, :default => false t.boolean :deleted, :default => false t.boolean :copies, :default => false t.string :ancestry t. end add_index :messages, [:user_id, :subject_id, :ancestry], :name => "messages_idx" end |