cardoni/digital_schoolhouse — Issue #3: Added "User", "Attachment", and "Post" Models/Associations
Author: cardoni
Created: 2012-02-21 23:07:22+00:00
State: open

create_table "attachments", :force => true do |t|
t.string "provider"
t.string "attachment_url"
t.text "description"
t.string "copyright_info"
t.integer "user_id"
t.integer "post_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "posts", :force => true do |t|
t.string "title"
t.text "body"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "users", :force => true do |t|
t.string "name"
t.string "email"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

Associations:

User:
has_many :posts
has_many :attachments

Attachment:
belongs_to :post
belongs_to :user

Post:
has_many :attachments
belongs_to :user