Skip to content

Commit c4db5c9

Browse files
committed
Optionally disable database initialization/update using environment variables (#40)
1 parent d76570f commit c4db5c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ExtensionInstaller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
131131
}
132132

133133
// initialize database schema
134-
if (!empty($extra['roundcube']['sql-dir'])) {
134+
if (!empty($extra['roundcube']['sql-dir']) && !getenv('SKIP_DB_INIT')) {
135135
if ($sqldir = realpath($package_dir . \DIRECTORY_SEPARATOR . $extra['roundcube']['sql-dir'])) {
136136
$this->io->write("<info>Running database initialization script for {$package_name}</info>");
137137

@@ -197,7 +197,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini
197197
$fs->remove($temp_dir);
198198

199199
// update database schema
200-
if (!empty($extra['roundcube']['sql-dir'])) {
200+
if (!empty($extra['roundcube']['sql-dir']) && !getenv('SKIP_DB_UPDATE')) {
201201
if ($sqldir = realpath($package_dir . \DIRECTORY_SEPARATOR . $extra['roundcube']['sql-dir'])) {
202202
$this->io->write("<info>Updating database schema for {$package_name}</info>");
203203

0 commit comments

Comments
 (0)