Class: CreateMessages

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

Class Method Summary collapse

Class Method Details

.downObject



21
22
23
# File 'lib/generators/templates/create_messages.rb', line 21

def self.down
  drop_table :messages
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/generators/templates/create_messages.rb', line 2

def self.up
  create_table :messages, :force => true do |t|
    t.string :name
    t.string :subject
    t.string :email
    t.text :body
    t.string :messagable_type
    t.integer :messagable_id
    t.integer :user_id
    t.string :image_file_name
    t.string :image_content_type
    t.integer :image_file_size
    t.datetime :image_updated_at
    t.timestamps
  end
  add_index :messages, :messagable_type
  add_index :messages, :messagable_id
end