Skip to content

Commit

Permalink
Merge pull request #219 from luke83/patch-1
Browse files Browse the repository at this point in the history
Use cached version of table schema
  • Loading branch information
HavokInspiration committed May 6, 2016
2 parents 1111dc2 + 204e9e7 commit 113deb0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/View/Helper/MigrationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 113deb0

Please sign in to comment.