diff --git a/src/View/Helper/MigrationHelper.php b/src/View/Helper/MigrationHelper.php index 2ce07fb2..a7e1070b 100644 --- a/src/View/Helper/MigrationHelper.php +++ b/src/View/Helper/MigrationHelper.php @@ -205,8 +205,7 @@ public function constraints($table) */ public function primaryKeys($table) { - $collection = $this->config('collection'); - $tableSchema = $collection->describe($table); + $tableSchema = $this->schema($table); $primaryKeys = []; $tablePrimaryKeys = $tableSchema->primaryKey(); foreach ($tableSchema->columns() as $column) { @@ -227,8 +226,7 @@ public function primaryKeys($table) public function hasUnsignedPrimaryKey($tables) { foreach ($tables as $table) { - $collection = $this->config('collection'); - $tableSchema = $collection->describe($table); + $tableSchema = $this->schema($table); $tablePrimaryKeys = $tableSchema->primaryKey(); foreach ($tablePrimaryKeys as $primaryKey) { @@ -307,8 +305,7 @@ public function value($value) */ public function attributes($table, $column) { - $collection = $this->config('collection'); - $tableSchema = $collection->describe($table); + $tableSchema = $this->schema($table); $validOptions = [ 'length', 'limit', 'default', 'null',