Class: CreateMailItems

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/private_mail/install/templates/create_mail_items.rb

Class Method Summary collapse

Class Method Details

.downObject



15
16
17
# File 'lib/generators/private_mail/install/templates/create_mail_items.rb', line 15

def self.down
  drop_table :mail_items
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/generators/private_mail/install/templates/create_mail_items.rb', line 2

def self.up
  create_table :mail_items do |t|
    t.column :user_id, :integer, :null => false
    t.column :message_id, :integer, :null => false
    t.column :conversation_id, :integer
    t.column :read, :boolean, :default => false
    t.column :trashed, :boolean, :default => false
    t.column :mailbox, :string, :limit => 25
    t.column :created_at, :datetime, :null => false
  end
  #i use foreign keys but its a custom method, so i'm leaving it up to you want them.
end