Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(9)

Side by Side Diff: db/migrate/002_add_photos_table.rb

Issue 2323: Upgrade to Rails 2 SVN Base: http://familyconnect.rubyforge.org/svn/trunk/
Patch Set: Created 1 year, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 class AddPhotosTable < ActiveRecord::Migration
2 def self.up
3 create_table :photos do |t|
4 t.column :news_item_id, :integer
5 t.column :image, :string
6 t.column :description, :string
7 t.column :created_at, :datetime
8 t.column :updated_at, :datetime
9 t.column :created_by_id, :integer
10 t.column :updated_by_id, :integer
11 end
12
13 create_table :tags do |t|
14 t.column :name, :string
15 end
16
17 create_table :tags_news_items, :id => false do |t|
18 t.column :tag_id, :integer
19 t.column :news_item_id, :integer
20 end
21
22 create_table :tags_photos, :id => false do |t|
23 t.column :tag_id, :integer
24 t.column :photo_id, :integer
25 end
26
27 add_column :news_items, :updated_at, :datetime
28 end
29
30 def self.down
31 remove_column :news_items, :updated_at
32
33 drop_table :tags_photos
34 drop_table :tags_news_items
35 drop_table :tags
36 drop_table :photos
37 end
38 end
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r483