mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-18 17:38:42 +00:00
fix bug where mapper was loaded before it got changed
This commit is contained in:
parent
2195a7135b
commit
1153638e24
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\News\Admin\Install;
|
namespace Modules\News\Admin\Install;
|
||||||
|
|
||||||
use Modules\News\Models\NewsArticleMapper;
|
use phpOMS\Autoloader;
|
||||||
use phpOMS\DataStorage\Database\DatabasePool;
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
use phpOMS\DataStorage\Database\Schema\Builder;
|
use phpOMS\DataStorage\Database\Schema\Builder;
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ class Comments
|
||||||
public static function install(string $path, DatabasePool $dbPool) : void
|
public static function install(string $path, DatabasePool $dbPool) : void
|
||||||
{
|
{
|
||||||
$builder = new Builder($dbPool->get('schema'));
|
$builder = new Builder($dbPool->get('schema'));
|
||||||
$builder->alterTable(NewsArticleMapper::getTable())
|
$builder->alterTable('news')
|
||||||
->addConstraint('news_comment_list', 'comment_list', 'comment_list_id');
|
->addConstraint('news_comment_list', 'comment_list', 'comment_list_id');
|
||||||
|
|
||||||
$mapper = \file_get_contents(__DIR__ . '/../../Models/NewsArticleMapper.php');
|
$mapper = \file_get_contents(__DIR__ . '/../../Models/NewsArticleMapper.php');
|
||||||
|
|
@ -52,6 +52,6 @@ class Comments
|
||||||
], '', $mapper);
|
], '', $mapper);
|
||||||
\file_put_contents(__DIR__ . '/../../Models/NewsArticleMapper.php', $mapper);
|
\file_put_contents(__DIR__ . '/../../Models/NewsArticleMapper.php', $mapper);
|
||||||
|
|
||||||
\opcache_invalidate(__DIR__ . '/../../Models/NewsArticleMapper.php');
|
Autoloader::invalidate(__DIR__ . '/../../Models/NewsArticleMapper.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user