mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 07:13:11 +08:00
Created script to update an already existing system
This commit is contained in:
@@ -44,6 +44,11 @@ class InstallCommand extends Command
|
||||
*/
|
||||
private $configWriter;
|
||||
|
||||
/**
|
||||
* InstallCommand constructor.
|
||||
* @param WriterInterface $configWriter
|
||||
* @param callable|null $databaseCreationLogic
|
||||
*/
|
||||
public function __construct(WriterInterface $configWriter)
|
||||
{
|
||||
parent::__construct(null);
|
||||
@@ -94,8 +99,7 @@ class InstallCommand extends Command
|
||||
$output->writeln(['<info>Custom configuration properly generated!</info>', '']);
|
||||
|
||||
// Generate database
|
||||
$output->writeln('Initializing database...');
|
||||
if (! $this->runCommand('php vendor/bin/doctrine.php orm:schema-tool:create', 'Error generating database.')) {
|
||||
if (! $this->createDatabase()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -273,6 +277,12 @@ class InstallCommand extends Command
|
||||
return $config;
|
||||
}
|
||||
|
||||
protected function createDatabase()
|
||||
{
|
||||
$this->output->writeln('Initializing database...');
|
||||
return $this->runCommand('php vendor/bin/doctrine.php orm:schema-tool:create', 'Error generating database.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @param string $errorMessage
|
||||
|
||||
Reference in New Issue
Block a user