diff --git a/data/migrations/Version20160819142757.php b/data/migrations/Version20160819142757.php
index 75c30018..40200c53 100644
--- a/data/migrations/Version20160819142757.php
+++ b/data/migrations/Version20160819142757.php
@@ -25,7 +25,7 @@ class Version20160819142757 extends AbstractMigration
if ($db === self::MYSQL) {
$column->setPlatformOption('collation', 'utf8_bin');
} elseif ($db === self::SQLITE) {
- $column->setPlatformOption('collation', 'BINARY');
+ $column->setPlatformOption('collate', 'BINARY');
}
}
diff --git a/module/CLI/src/Command/Install/InstallCommand.php b/module/CLI/src/Command/Install/InstallCommand.php
index 6df92f26..75eac1ef 100644
--- a/module/CLI/src/Command/Install/InstallCommand.php
+++ b/module/CLI/src/Command/Install/InstallCommand.php
@@ -95,31 +95,20 @@ class InstallCommand extends Command
// Generate database
$output->writeln('Initializing database...');
- $process = $this->processHelper->run($output, 'php vendor/bin/doctrine.php orm:schema-tool:create');
- if ($process->isSuccessful()) {
- $output->writeln(' Success!');
- } else {
- if ($output->isVerbose()) {
- return;
- }
- $output->writeln(
- ' Error generating database. Run this command with -vvv to see specific error info.'
- );
+ if (! $this->runCommand('php vendor/bin/doctrine.php orm:schema-tool:create', 'Error generating database.')) {
+ return;
+ }
+
+ // Run database migrations
+ $output->writeln('Updating database...');
+ if (! $this->runCommand('php vendor/bin/doctrine-migrations migrations:migrate', 'Error updating database.')) {
return;
}
// Generate proxies
$output->writeln('Generating proxies...');
- $process = $this->processHelper->run($output, 'php vendor/bin/doctrine.php orm:generate-proxies');
- if ($process->isSuccessful()) {
- $output->writeln(' Success!');
- } else {
- if ($output->isVerbose()) {
- return;
- }
- $output->writeln(
- ' Error generating proxies. Run this command with -vvv to see specific error info.'
- );
+ if (! $this->runCommand('php vendor/bin/doctrine.php orm:generate-proxies', 'Error generating proxies.')) {
+ return;
}
}
@@ -283,4 +272,26 @@ class InstallCommand extends Command
return $config;
}
+
+ /**
+ * @param string $command
+ * @param string $errorMessage
+ * @return bool
+ */
+ protected function runCommand($command, $errorMessage)
+ {
+ $process = $this->processHelper->run($this->output, $command);
+ if ($process->isSuccessful()) {
+ $this->output->writeln(' Success!');
+ return true;
+ } else {
+ if ($this->output->isVerbose()) {
+ return false;
+ }
+ $this->output->writeln(
+ ' ' . $errorMessage . ' Run this command with -vvv to see specific error info.'
+ );
+ return false;
+ }
+ }
}
diff --git a/phpcs.xml b/phpcs.xml
index 5b686079..bd3ef63a 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -18,6 +18,7 @@
bin
module
+ data/migrations
config
public/index.php
config/params/*