Class: CreateLinks

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

Class Method Summary collapse

Class Method Details

.downObject



13
14
15
# File 'lib/generators/templates/create_links.rb', line 13

def self.down
  drop_table :links
end

.upObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/templates/create_links.rb', line 2

def self.up
  create_table :links, :force => true do |t|
    t.integer :post_id
    t.string :caption
    t.string :url
    t.integer :display_order, :default => 0
    t.timestamps
  end
  add_index :links, :post_id
end