From 99b36598c7c772ed2a4ddb09a1d903eece5c8bba Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sun, 7 Jun 2015 17:04:24 +0200 Subject: [PATCH] add migration to fix public flag of photos --- db/migrate/20150607143809_fix_photo_public_flag.rb | 9 +++++++++ db/schema.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20150607143809_fix_photo_public_flag.rb diff --git a/db/migrate/20150607143809_fix_photo_public_flag.rb b/db/migrate/20150607143809_fix_photo_public_flag.rb new file mode 100644 index 000000000..fa75167ef --- /dev/null +++ b/db/migrate/20150607143809_fix_photo_public_flag.rb @@ -0,0 +1,9 @@ +class FixPhotoPublicFlag < ActiveRecord::Migration + def up + Photo.joins(:status_message).where(posts: {public: true}).update_all(public: true) + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/schema.rb b/db/schema.rb index 76494c104..959c12c99 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150531005120) do +ActiveRecord::Schema.define(version: 20150607143809) do create_table "account_deletions", force: :cascade do |t| t.string "diaspora_handle", limit: 255