aboutsummaryrefslogtreecommitdiffstats
path: root/guides/code/getting_started/db
diff options
context:
space:
mode:
Diffstat (limited to 'guides/code/getting_started/db')
-rw-r--r--guides/code/getting_started/db/migrate/20130122042648_create_posts.rb (renamed from guides/code/getting_started/db/migrate/20120420083127_create_posts.rb)0
-rw-r--r--guides/code/getting_started/db/migrate/20130122045842_create_comments.rb (renamed from guides/code/getting_started/db/migrate/20110901012815_create_comments.rb)3
-rw-r--r--guides/code/getting_started/db/schema.rb27
3 files changed, 10 insertions, 20 deletions
diff --git a/guides/code/getting_started/db/migrate/20120420083127_create_posts.rb b/guides/code/getting_started/db/migrate/20130122042648_create_posts.rb
index 602bef31ab..602bef31ab 100644
--- a/guides/code/getting_started/db/migrate/20120420083127_create_posts.rb
+++ b/guides/code/getting_started/db/migrate/20130122042648_create_posts.rb
diff --git a/guides/code/getting_started/db/migrate/20110901012815_create_comments.rb b/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb
index adda8078c1..3e51f9c0f7 100644
--- a/guides/code/getting_started/db/migrate/20110901012815_create_comments.rb
+++ b/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb
@@ -3,10 +3,9 @@ class CreateComments < ActiveRecord::Migration
create_table :comments do |t|
t.string :commenter
t.text :body
- t.references :post
+ t.references :post, index: true
t.timestamps
end
- add_index :comments, :post_id
end
end
diff --git a/guides/code/getting_started/db/schema.rb b/guides/code/getting_started/db/schema.rb
index cfb56ca9b9..101fe712a1 100644
--- a/guides/code/getting_started/db/schema.rb
+++ b/guides/code/getting_started/db/schema.rb
@@ -9,34 +9,25 @@
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
-# It's strongly recommended to check this file into your version control system.
+# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120420083127) do
+ActiveRecord::Schema.define(version: 20130122045842) do
- create_table "comments", :force => true do |t|
+ create_table "comments", force: true do |t|
t.string "commenter"
t.text "body"
t.integer "post_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
- add_index "comments", ["post_id"], :name => "index_comments_on_post_id"
+ add_index "comments", ["post_id"], name: "index_comments_on_post_id"
- create_table "posts", :force => true do |t|
+ create_table "posts", force: true do |t|
t.string "title"
t.text "text"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
- create_table "tags", :force => true do |t|
- t.string "name"
- t.integer "post_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "tags", ["post_id"], :name => "index_tags_on_post_id"
-
end