port PHRAS-2468: don't drop log_colls (#2959)

This commit is contained in:
aynsix
2019-03-27 15:02:30 +04:00
committed by jygaulier
parent e9f363de1d
commit 905ddcb836
2 changed files with 21 additions and 0 deletions

View File

@@ -50,6 +50,21 @@ class patch_380alpha3a extends patchAbstract
{
$conn = $databox->get_connection();
$sql = "CREATE TABLE IF NOT EXISTS `log_colls` (\n"
. " `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n"
. " `log_id` int(11) unsigned NOT NULL,\n"
. " `coll_id` int(11) unsigned NOT NULL,\n"
. " PRIMARY KEY (`id`),\n"
. " UNIQUE KEY `couple` (`log_id`,`coll_id`),\n"
. " KEY `log_id` (`log_id`),\n"
. " KEY `coll_id` (`coll_id`)\n"
. ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
$stmt = $conn->prepare($sql);
$stmt->execute();
$stmt->closeCursor();
unset($stmt);
$removeProc = "DROP PROCEDURE IF EXISTS explode_log_table";
$stmt = $conn->prepare($removeProc);

View File

@@ -60,8 +60,14 @@ class patch_410alpha13a implements patchInterface
*/
public function apply(base $databox, Application $app)
{
// @see : https://phraseanet.atlassian.net/browse/PHRAS-2468
// to be able to migrate from 3.5 to 4.0.8, we must not delete the table anymore
// so the cli "bin/setup patch:log_coll_id" can be executed.
/*
$sql = "DROP TABLE IF EXISTS `log_colls`";
$databox->get_connection()->prepare($sql)->execute();
*/
/*
* no need to do those ops, it's done by system:upgrade after fixing the xml scheme