Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
samrund committed May 6, 2015
1 parent acff3d7 commit ad74725
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions db/migrate/20150506205248_add_categories_posts_relation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddCategoriesPostsRelation < ActiveRecord::Migration
def change
add_reference :posts, :category, index: true
end
end
11 changes: 7 additions & 4 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150506185701) do
ActiveRecord::Schema.define(version: 20150506205248) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand All @@ -27,12 +27,15 @@
end

create_table "posts", force: :cascade do |t|
t.string "title", limit: 500
t.string "title", limit: 500
t.text "body"
t.string "link", limit: 2000
t.string "link", limit: 2000
t.datetime "created_at"
t.datetime "updated_at"
t.integer "post_type", default: 0
t.integer "post_type", default: 0
t.integer "category_id"
end

add_index "posts", ["category_id"], name: "index_posts_on_category_id", using: :btree

end

0 comments on commit ad74725

Please sign in to comment.