From d4705e9bbf87627ff32d5caaba68dc351da01d9d Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Wed, 17 Apr 2013 16:42:04 +0100 Subject: [PATCH] Add icon_size column to subscriptions --- .../20130417153542_add_icon_size_to_subscriptions.rb | 10 ++++++++++ db/schema.rb | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20130417153542_add_icon_size_to_subscriptions.rb diff --git a/db/migrate/20130417153542_add_icon_size_to_subscriptions.rb b/db/migrate/20130417153542_add_icon_size_to_subscriptions.rb new file mode 100644 index 0000000..584aae6 --- /dev/null +++ b/db/migrate/20130417153542_add_icon_size_to_subscriptions.rb @@ -0,0 +1,10 @@ +class AddIconSizeToSubscriptions < ActiveRecord::Migration + def up + add_column :subscriptions, :icon_size, :integer, :default => 12 + Subscription.all.each { |s| s.update_attribute :icon_size, 12 } + end + + def down + remove_column :subscriptions, :icon_size + end +end diff --git a/db/schema.rb b/db/schema.rb index 484c6e2..b8ec01f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130410153407) do +ActiveRecord::Schema.define(:version => 20130417153542) do create_table "delayed_jobs", :force => true do |t| t.integer "priority", :default => 0 @@ -38,6 +38,7 @@ ActiveRecord::Schema.define(:version => 20130410153407) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.datetime "last_fetched" + t.string "favicon_url" end create_table "layers", :force => true do |t| @@ -67,6 +68,7 @@ ActiveRecord::Schema.define(:version => 20130410153407) do t.datetime "created_at" t.datetime "updated_at" t.string "icon_url" + t.integer "icon_size", :default => 12 end add_index "subscriptions", ["feed_id", "layer_id"], :name => "index_feeds_layers_on_feed_id_and_layer_id", :unique => true