Class: CreateGalleries

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/forge/db/migrate/20130405172041_create_galleries.rb

Instance Method Summary collapse

Instance Method Details

#downObject



25
26
27
28
# File 'lib/forge/db/migrate/20130405172041_create_galleries.rb', line 25

def down
  drop_table :galleries
  drop_table :photos
end

#upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/forge/db/migrate/20130405172041_create_galleries.rb', line 2

def up
  create_table "galleries" do |t|
    t.string   "title"
    t.integer  "list_order"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "photos" do |t|
    t.integer  "gallery_id"
    t.integer  "list_order"
    t.string   "title"
    t.integer  "file_file_size"
    t.string   "file_file_name"
    t.string   "file_content_type"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "photos", ["gallery_id"], :name => "index_photos_on_gallery_id"
  add_index "photos", ["list_order"], :name => "index_photos_on_list_order"
end