diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php index 6e6948ece..b95e92fac 100644 --- a/modules/system/classes/UpdateManager.php +++ b/modules/system/classes/UpdateManager.php @@ -119,7 +119,7 @@ class UpdateManager */ public function update() { - $firstUp = !Schema::hasTable('migrations'); + $firstUp = !Schema::hasTable(Config::get('database.migrations')); if ($firstUp) { $this->repository->createRepository(); $this->note('Migration table created'); @@ -337,7 +337,7 @@ class UpdateManager } } - Schema::dropIfExists('migrations'); + Schema::dropIfExists(Config::get('database.migrations')); return $this; } diff --git a/modules/system/database/migrations/2014_10_01_000010_Db_Jobs.php b/modules/system/database/migrations/2014_10_01_000010_Db_Jobs.php index d00239bd7..681f61092 100644 --- a/modules/system/database/migrations/2014_10_01_000010_Db_Jobs.php +++ b/modules/system/database/migrations/2014_10_01_000010_Db_Jobs.php @@ -7,7 +7,7 @@ class DbJobs extends Migration { public function up() { - Schema::create('jobs', function (Blueprint $table) { + Schema::create(Config::get('queue.connections.database.table'), function (Blueprint $table) { $table->engine = 'InnoDB'; $table->bigIncrements('id'); $table->string('queue'); @@ -22,6 +22,6 @@ class DbJobs extends Migration public function down() { - Schema::dropIfExists('jobs'); + Schema::dropIfExists(Config::get('queue.connections.database.table')); } } diff --git a/modules/system/database/migrations/2015_10_01_000018_Db_FailedJobs.php b/modules/system/database/migrations/2015_10_01_000018_Db_FailedJobs.php index 4c528d879..6c7887251 100644 --- a/modules/system/database/migrations/2015_10_01_000018_Db_FailedJobs.php +++ b/modules/system/database/migrations/2015_10_01_000018_Db_FailedJobs.php @@ -7,7 +7,7 @@ class DbFailedJobs extends Migration { public function up() { - Schema::create('failed_jobs', function (Blueprint $table) { + Schema::create(Config::get('queue.failed.table'), function (Blueprint $table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->text('connection'); @@ -19,6 +19,6 @@ class DbFailedJobs extends Migration public function down() { - Schema::dropIfExists('failed_jobs'); + Schema::dropIfExists(Config::get('queue.failed.table')); } } diff --git a/modules/system/database/migrations/2016_10_01_000020_Db_System_Timestamp_Fix.php b/modules/system/database/migrations/2016_10_01_000020_Db_System_Timestamp_Fix.php index 5a2c8d4a9..794182f25 100644 --- a/modules/system/database/migrations/2016_10_01_000020_Db_System_Timestamp_Fix.php +++ b/modules/system/database/migrations/2016_10_01_000020_Db_System_Timestamp_Fix.php @@ -10,24 +10,11 @@ use October\Rain\Database\Updates\Migration; */ class DbSystemTimestampFix extends Migration { - protected $coreTables = [ - 'deferred_bindings', - 'failed_jobs' => 'failed_at', - 'system_files', - 'system_event_logs', - 'system_mail_layouts', - 'system_mail_templates', - 'system_plugin_history' => 'created_at', - 'system_plugin_versions' => 'created_at', - 'system_request_logs', - 'system_revisions', - ]; - public function up() { DbDongle::disableStrictMode(); - foreach ($this->coreTables as $table => $columns) { + foreach ($this->getCoreTables() as $table => $columns) { if (is_int($table)) { $table = $columns; $columns = ['created_at', 'updated_at']; @@ -41,4 +28,20 @@ class DbSystemTimestampFix extends Migration { // ... } + + private function getCoreTables() + { + return [ + 'deferred_bindings', + Config::get('queue.failed.table') => 'failed_at', + 'system_files', + 'system_event_logs', + 'system_mail_layouts', + 'system_mail_templates', + 'system_plugin_history' => 'created_at', + 'system_plugin_versions' => 'created_at', + 'system_request_logs', + 'system_revisions', + ]; + } }