Skip to content

Commit

Permalink
Merge pull request #2060 from dmeltzer/fix-settings-table-for-sqlite
Browse files Browse the repository at this point in the history
Fix updates from v2
  • Loading branch information
snipe committed May 20, 2016
2 parents f6cdd90 + c52e3b5 commit 0729238
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public function up()
{
Schema::table('settings', function (Blueprint $table) {
//
$table->dropColumn('option_name');
$table->dropColumn('option_value');
if(Schema::hasColumn('option_name', 'settings'))
$table->dropColumn('option_name');
});
}

Expand All @@ -28,6 +28,7 @@ public function down()
{
Schema::table('Settings', function (Blueprint $table) {
//
$table->string('option_name')->nullable();
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class RemoveOptionValueFromSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
//
if(Schema::hasColumn('option_value', 'settings'))
$table->dropColumn('option_value');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::table('settings', function (Blueprint $table) {
$table->string('option_value')->nullable();
});
}
}

0 comments on commit 0729238

Please sign in to comment.