aboutsummaryrefslogtreecommitdiffstats
path: root/guides/code/getting_started/db
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-04-20 10:43:50 +0200
committerOscar Del Ben <info@oscardelben.com>2012-04-20 10:43:50 +0200
commitf6d5036dd620da48624ce32494f63aa4221b05d5 (patch)
treeb023a6730c5dffee1a5724d7c026bfa369efeccf /guides/code/getting_started/db
parent0d5a7ad84ddbcb4de7c327e39a7747e00b0cd89f (diff)
downloadrails-f6d5036dd620da48624ce32494f63aa4221b05d5.tar.gz
rails-f6d5036dd620da48624ce32494f63aa4221b05d5.tar.bz2
rails-f6d5036dd620da48624ce32494f63aa4221b05d5.zip
Adapt "Getting started guide" code sample
Diffstat (limited to 'guides/code/getting_started/db')
-rw-r--r--guides/code/getting_started/db/migrate/20120420083127_create_posts.rb (renamed from guides/code/getting_started/db/migrate/20110901012504_create_posts.rb)3
-rw-r--r--guides/code/getting_started/db/schema.rb17
2 files changed, 9 insertions, 11 deletions
diff --git a/guides/code/getting_started/db/migrate/20110901012504_create_posts.rb b/guides/code/getting_started/db/migrate/20120420083127_create_posts.rb
index d45a961523..602bef31ab 100644
--- a/guides/code/getting_started/db/migrate/20110901012504_create_posts.rb
+++ b/guides/code/getting_started/db/migrate/20120420083127_create_posts.rb
@@ -1,9 +1,8 @@
class CreatePosts < ActiveRecord::Migration
def change
create_table :posts do |t|
- t.string :name
t.string :title
- t.text :content
+ t.text :text
t.timestamps
end
diff --git a/guides/code/getting_started/db/schema.rb b/guides/code/getting_started/db/schema.rb
index 9db4fbe4b6..cfb56ca9b9 100644
--- a/guides/code/getting_started/db/schema.rb
+++ b/guides/code/getting_started/db/schema.rb
@@ -11,31 +11,30 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20110901013701) do
+ActiveRecord::Schema.define(:version => 20120420083127) do
create_table "comments", :force => true do |t|
t.string "commenter"
t.text "body"
t.integer "post_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "comments", ["post_id"], :name => "index_comments_on_post_id"
create_table "posts", :force => true do |t|
- t.string "name"
t.string "title"
- t.text "content"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.text "text"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "tags", :force => true do |t|
t.string "name"
t.integer "post_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "tags", ["post_id"], :name => "index_tags_on_post_id"