This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
binaryattraction/schema/migrations/002_create_photos_migration.rb

17 lines
400 B
Ruby

class CreatePhotosMigration < ActiveRecord::Migration
def self.up
create_table :photos do |t|
t.string :filename, :content_type, :email_hash
t.integer :width, :height, :user_id
t.datetime :created_at
t.boolean :approved, :default => false
end
add_index :photos, :email_hash
add_index :photos, :user_id
end
def self.down
drop_table :photos
end
end