From 32b7845a38f163432750b4b04ef7ae60b66db39e Mon Sep 17 00:00:00 2001 From: antonkomarev Date: Fri, 13 Sep 2019 22:19:30 +0300 Subject: [PATCH 1/2] Configure Schema on migration instantiation --- .../Database/Migrations/Migration.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Illuminate/Database/Migrations/Migration.php b/src/Illuminate/Database/Migrations/Migration.php index a58f7848a7e1..86f7e4b29c27 100755 --- a/src/Illuminate/Database/Migrations/Migration.php +++ b/src/Illuminate/Database/Migrations/Migration.php @@ -2,8 +2,17 @@ namespace Illuminate\Database\Migrations; +use Illuminate\Support\Facades\Schema; + abstract class Migration { + /** + * The database schema. + * + * @var \Illuminate\Support\Facades\Schema + */ + protected $schema; + /** * The name of the database connection to use. * @@ -18,6 +27,16 @@ abstract class Migration */ public $withinTransaction = true; + /** + * Create a new migration instance. + * + * @return void + */ + public function __construct() + { + $this->schema = Schema::connection($this->getConnection()); + } + /** * Get the migration connection name. * From 6ed10e777eefee5ee475ec25b490d1a9d5b7fe17 Mon Sep 17 00:00:00 2001 From: antonkomarev Date: Sat, 14 Sep 2019 04:10:57 +0300 Subject: [PATCH 2/2] Fix variable type in DocBlock --- src/Illuminate/Database/Migrations/Migration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Migrations/Migration.php b/src/Illuminate/Database/Migrations/Migration.php index 86f7e4b29c27..64c74353cddd 100755 --- a/src/Illuminate/Database/Migrations/Migration.php +++ b/src/Illuminate/Database/Migrations/Migration.php @@ -9,7 +9,7 @@ abstract class Migration /** * The database schema. * - * @var \Illuminate\Support\Facades\Schema + * @var \Illuminate\Database\Schema\Builder */ protected $schema;