Class: CreateEventsAndPhotos

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

Instance Method Summary collapse

Instance Method Details

#changeObject



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

def change
create_table(:photos_manager_events) do |t|
	t.string :title
	t.date :event_date

	t.timestamps
end

create_table(:photos_manager_photos) do |t|
	t.string 	:title
	t.text 		:description
	t.date 		:date
	t.integer :event_id,	:null => false
	t.string 	:image, 		:null => false
	
	t.timestamps
end

end