From f6d5036dd620da48624ce32494f63aa4221b05d5 Mon Sep 17 00:00:00 2001 From: Oscar Del Ben Date: Fri, 20 Apr 2012 10:43:50 +0200 Subject: Adapt "Getting started guide" code sample --- .../db/migrate/20110901012504_create_posts.rb | 11 ----------- .../db/migrate/20120420083127_create_posts.rb | 10 ++++++++++ guides/code/getting_started/db/schema.rb | 17 ++++++++--------- 3 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 guides/code/getting_started/db/migrate/20110901012504_create_posts.rb create mode 100644 guides/code/getting_started/db/migrate/20120420083127_create_posts.rb (limited to 'guides/code/getting_started/db') diff --git a/guides/code/getting_started/db/migrate/20110901012504_create_posts.rb b/guides/code/getting_started/db/migrate/20110901012504_create_posts.rb deleted file mode 100644 index d45a961523..0000000000 --- a/guides/code/getting_started/db/migrate/20110901012504_create_posts.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreatePosts < ActiveRecord::Migration - def change - create_table :posts do |t| - t.string :name - t.string :title - t.text :content - - t.timestamps - end - end -end diff --git a/guides/code/getting_started/db/migrate/20120420083127_create_posts.rb b/guides/code/getting_started/db/migrate/20120420083127_create_posts.rb new file mode 100644 index 0000000000..602bef31ab --- /dev/null +++ b/guides/code/getting_started/db/migrate/20120420083127_create_posts.rb @@ -0,0 +1,10 @@ +class CreatePosts < ActiveRecord::Migration + def change + create_table :posts do |t| + t.string :title + t.text :text + + t.timestamps + end + end +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" -- cgit v1.2.3