From 16cf699d4b33bee6b751e5abee775b6bb874f168 Mon Sep 17 00:00:00 2001 From: embs Date: Thu, 4 Apr 2013 19:19:50 -0300 Subject: [PATCH] Fix default image url in profiles table. Closes #3795 --- Changelog.md | 1 + .../20130404211624_fix_default_image_url_from_profile.rb | 9 +++++++++ db/schema.rb | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20130404211624_fix_default_image_url_from_profile.rb diff --git a/Changelog.md b/Changelog.md index d6989d0bf..f7de3b076 100644 --- a/Changelog.md +++ b/Changelog.md @@ -113,6 +113,7 @@ by them self. * Send profile alongside notification [#3976] (https://github.com/diaspora/diaspora/issues/3976) * Fix off-center close button image on intro popovers [#3841](https://github.com/diaspora/diaspora/pull/3841) * Remove unnecessary dotted CSS borders. [#2940](https://github.com/diaspora/diaspora/issues/2940) +* Fix default image url in profiles table. [#3795](https://github.com/diaspora/diaspora/issues/3795) ## Features diff --git a/db/migrate/20130404211624_fix_default_image_url_from_profile.rb b/db/migrate/20130404211624_fix_default_image_url_from_profile.rb new file mode 100644 index 000000000..4749728fc --- /dev/null +++ b/db/migrate/20130404211624_fix_default_image_url_from_profile.rb @@ -0,0 +1,9 @@ +class FixDefaultImageUrlFromProfile < ActiveRecord::Migration + def up + execute("UPDATE profiles SET image_url = REPLACE(image_url, 'images', 'assets'), image_url_small = REPLACE(image_url_small, 'images', 'assets'), image_url_medium = REPLACE(image_url_medium, 'images', 'assets') WHERE image_url LIKE '%images/user/default.png';") + end + + def down + execute("UPDATE profiles SET image_url = REPLACE(image_url, 'assets', 'images'), image_url_small = REPLACE(image_url_small, 'assets', 'images'), image_url_medium = REPLACE(image_url_medium, 'assets', 'images') WHERE image_url LIKE '%assets/user/default.png';") + end +end diff --git a/db/schema.rb b/db/schema.rb index 11e42a8dd..9b1ff820f 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 => 20130207231310) do +ActiveRecord::Schema.define(:version => 20130404211624) do create_table "account_deletions", :force => true do |t| t.string "diaspora_handle"