diff --git a/db/migrations/1.254_hash_opengraph_table.php b/db/migrations/1.254_hash_opengraph_table.php
index 886214668c4d76e1ac25086136a915716e1d68a4..9d8ede59b794259d7183d97ee1450ef243f93233 100644
--- a/db/migrations/1.254_hash_opengraph_table.php
+++ b/db/migrations/1.254_hash_opengraph_table.php
@@ -3,6 +3,10 @@ class HashOpengraphTable extends Migration
 {
     public function up()
     {
+        //Prevent duplicate entries in one of the following queries
+        //by deleting all entries in the opengraphdata table:
+        DBManager::get()->exec("DELETE FROM `opengraphdata`");
+
         $query = "ALTER TABLE `opengraphdata`
                   ADD COLUMN `hash` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' AFTER `opengraph_id`";
         DBManager::get()->exec($query);