--- /dev/null
+class CreateFeedItems < ActiveRecord::Migration
+ def self.up
+ create_table :feed_items do |t|
+ t.string :feed_name
+ t.string :title
+ t.text :description
+
+ t.timestamps
+ end
+
+ add_index :feed_items, :feed_name
+ end
+
+ def self.down
+ remove_index :feed_items, :feed_name
+
+ drop_table :feed_items
+ end
+end
--- /dev/null
+class AddTestData < ActiveRecord::Migration
+ def self.up
+ FeedItem.delete_all
+ (1..20).each do |item_number|
+ ('a'..'j').each do |feed_name|
+ FeedItem.create(:feed_name => "feed-#{feed_name}",
+ :title => "feed-#{feed_name}-item-" + sprintf("%02d", item_number),
+ :description => "Feed #{feed_name}, Item #{item_number} has a description")
+ end
+ end
+ end
+
+ def self.down
+ FeedItem.delete_all
+ end
+end
--- /dev/null
+# This file is auto-generated from the current state of the database. Instead of editing this file,
+# please use the migrations feature of Active Record to incrementally modify your database, and
+# then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your database schema. If you need
+# to create the application database on another system, you should be using db:schema:load, not running
+# all the migrations 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.
+
+ActiveRecord::Schema.define(:version => 20090717095948) do
+
+ create_table "feed_items", :force => true do |t|
+ t.string "feed_name"
+ t.string "title"
+ t.text "description"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "feed_items", ["feed_name"], :name => "index_feed_items_on_feed_name"
+
+end