flickrのアルバムを作る

rails mashalbum
cd mashalbum
./script/generate scaffold photo
./script/generate scaffold album
rake db:migrate VERSION=001


db/migrate/001_create_photos.rb

class CreatePhotos < ActiveRecord::Migration
  def self.up
    create_table :photos do |t|
      t.string :farm
      t.string :server
      t.string :photo_id, :null => false
      t.string :secret
      t.datetime :date_taken
      t.timestamps
    end
    add_index :photos, :photo_id
  end

  def self.down
    drop_table :photos
  end
end


app/models/photos.rb

class Photo < ActiveRecord::Base
end


app/models/album.rb

class Album < ActiveRecord::Base
end

albumはあとで考える。まずphotoから