Use aliases when migrating data. Fixes #2240

This commit is contained in:
James Brooks
2016-11-14 18:36:42 +00:00
parent f05156412e
commit 341bfb08a8
6 changed files with 53 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ namespace CachetHQ\Cachet\Integrations\Core;
use CachetHQ\Cachet\Integrations\Contracts\System as SystemContract;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Incident;
use Illuminate\Contracts\Config\Repository;
/**
* This is the core system class.
@@ -22,6 +23,25 @@ use CachetHQ\Cachet\Models\Incident;
*/
class System implements SystemContract
{
/**
* The illuminate config instance.
*
* @var \Illuminate\Contracts\Config\Repository
*/
protected $config;
/**
* Create a new system instance.
*
* @param \Illuminate\Contracts\Config\Repository $config
*
* @return void
*/
public function __construct(Repository $config)
{
$this->config = $config;
}
/**
* Get the entire system status.
*
@@ -80,4 +100,16 @@ class System implements SystemContract
{
return CACHET_VERSION;
}
/**
* Get the table prefix.
*
* @return string
*/
public function getTablePrefix()
{
$driver = $this->config->get('database.default');
return $this->config->get("database.connections.{$driver}.prefix");
}
}