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_articles.rb (renamed from guides/code/getting_started/db/migrate/20130122042648_create_posts.rb)4
-rw-r--r--guides/code/getting_started/db/migrate/20130122045842_create_comments.rb2
-rw-r--r--guides/code/getting_started/db/schema.rb18
3 files changed, 12 insertions, 12 deletions
diff --git a/guides/code/getting_started/db/migrate/20130122042648_create_posts.rb b/guides/code/getting_started/db/migrate/20130122042648_create_articles.rb
index 602bef31ab..6bb255e89f 100644
--- a/guides/code/getting_started/db/migrate/20130122042648_create_posts.rb
+++ b/guides/code/getting_started/db/migrate/20130122042648_create_articles.rb
@@ -1,6 +1,6 @@
-class CreatePosts < ActiveRecord::Migration
+class CreateArticles < ActiveRecord::Migration
def change
- create_table :posts do |t|
+ create_table :articles do |t|
t.string :title
t.text :text
diff --git a/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb b/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb
index 3e51f9c0f7..1f765839ac 100644
--- a/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb
+++ b/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb
@@ -3,7 +3,7 @@ class CreateComments < ActiveRecord::Migration
create_table :comments do |t|
t.string :commenter
t.text :body
- t.references :post, index: true
+ t.references :article, index: true
t.timestamps
end
diff --git a/guides/code/getting_started/db/schema.rb b/guides/code/getting_started/db/schema.rb
index 101fe712a1..be40f7cb0e 100644
--- a/guides/code/getting_started/db/schema.rb
+++ b/guides/code/getting_started/db/schema.rb
@@ -13,21 +13,21 @@
ActiveRecord::Schema.define(version: 20130122045842) do
- create_table "comments", force: true do |t|
- t.string "commenter"
- t.text "body"
- t.integer "post_id"
+ create_table "articles", force: true do |t|
+ t.string "title"
+ t.text "text"
t.datetime "created_at"
t.datetime "updated_at"
end
- add_index "comments", ["post_id"], name: "index_comments_on_post_id"
-
- create_table "posts", force: true do |t|
- t.string "title"
- t.text "text"
+ create_table "comments", force: true do |t|
+ t.string "commenter"
+ t.text "body"
+ t.integer "article_id"
t.datetime "created_at"
t.datetime "updated_at"
end
+ add_index "comments", ["article_id"], name: "index_comments_on_article_id"
+
end