Permalink
Browse files

Fixed database migration issue. Also corrected naming convention for …

…method 'updateUsersTable'
  • Loading branch information...
ericvanjohnson committed Jun 7, 2016
1 parent 281f663 commit c29f95156bd47d738db871498b5a3c184210c72d
Showing with 6 additions and 4 deletions.
  1. +6 −4 database/Migrations/2015_03_03_212000_create_users_table.php
@@ -26,7 +26,7 @@ public function up()
if (! Schema::hasTable('users')) {
$this->createUsersTable();
} else {
$this->updateUSersTable();
$this->updateUsersTable();
}
}
@@ -118,15 +118,17 @@ private function createUsersTable()
* Add the not existing columns
* to the existing users table
*/
private function updateUSersTable()
private function updateUsersTable()
{
Schema::table('users', function ($table) {
foreach ($this->fields as $field => $value) {
if (!Schema::hasColumn('users', $field)) {
$query = $table->$value['type']($field);
$type = $value['type'];
$query = $table->$type($field);
if (isset($value['extra'])) {
$query->$value['extra']();
$extra = $value['extra'];
$query->$extra();
}
if ($field == 'role_id') {

0 comments on commit c29f951

Please sign in to comment.