Class: CreateFeatures

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

Class Method Summary collapse

Class Method Details

.downObject



18
19
20
# File 'lib/generators/templates/create_features.rb', line 18

def self.down
  drop_table :features
end

.upObject



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

def self.up
  create_table :features, :force => true do |t|
    t.string :title
    t.integer :photo_id
    t.integer :post_id
    t.integer :display_order, :default => 0
    t.string :state
    t.string  :caption
    t.string  :url
    t.datetime :published_at
    t.timestamps
  end
  add_index :features, :photo_id
  add_index :features, :post_id
end