From ed0005c44d12e51629481f67164d6fee470841c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Tue, 9 Dec 2014 05:27:19 +0100 Subject: [PATCH] Add migration to drop invalid OpenGraphCaches, closes #5465 URI.extract recognized http:// as an URL, causing invalid associations. #5347 already fixed the parsing, this just cleans up the caches to get rid of the false associations. --- ...209041241_drop_open_graph_caches_with_invalid_urls.rb | 9 +++++++++ db/schema.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20141209041241_drop_open_graph_caches_with_invalid_urls.rb diff --git a/db/migrate/20141209041241_drop_open_graph_caches_with_invalid_urls.rb b/db/migrate/20141209041241_drop_open_graph_caches_with_invalid_urls.rb new file mode 100644 index 000000000..bfbfab884 --- /dev/null +++ b/db/migrate/20141209041241_drop_open_graph_caches_with_invalid_urls.rb @@ -0,0 +1,9 @@ +class DropOpenGraphCachesWithInvalidUrls < ActiveRecord::Migration + def up + OpenGraphCache.where(url: 'http://').delete_all + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/schema.rb b/db/schema.rb index d68d473ee..497151fd5 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: 20141024170120) do +ActiveRecord::Schema.define(version: 20141209041241) do create_table "account_deletions", force: true do |t| t.string "diaspora_handle"