Skip to content
Snippets Groups Projects
Commit fc2cb51d authored by Moritz Strohm's avatar Moritz Strohm
Browse files

migration 1.254: delete all data from opengraphdata table before altering it, fixes #1445

Closes #1445

Merge request !899
parent f652b374
Branches
No related tags found
No related merge requests found
...@@ -3,6 +3,10 @@ class HashOpengraphTable extends Migration ...@@ -3,6 +3,10 @@ class HashOpengraphTable extends Migration
{ {
public function up() 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` $query = "ALTER TABLE `opengraphdata`
ADD COLUMN `hash` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' AFTER `opengraph_id`"; ADD COLUMN `hash` CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' AFTER `opengraph_id`";
DBManager::get()->exec($query); DBManager::get()->exec($query);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment