Class: CreateContacts

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

Class Method Summary collapse

Class Method Details

.downObject



14
15
16
17
# File 'lib/generators/tkh_mailing_list/create_or_update_migrations/templates/create_contacts.rb', line 14

def self.down
  drop_table :contacts
  remove_index :contacts, :updated_at
end

.upObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/generators/tkh_mailing_list/create_or_update_migrations/templates/create_contacts.rb', line 3

def self.up
  create_table :contacts do |t|
    t.string :sender_name
    t.string :sender_email
    t.text :body
    
    t.timestamps
  end
  add_index :contacts, :updated_at
end