mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
parent
834e0a9dd5
commit
44eb67440a
|
@ -14,9 +14,16 @@ class AddProviderToOauthTable extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('oauth_clients', function (Blueprint $table) {
|
||||
$table->string('provider')->after('secret')->nullable();
|
||||
});
|
||||
// Add a 'provider' column if not existing or else modify it
|
||||
if (!Schema::hasColumn('oauth_clients', 'provider')) {
|
||||
Schema::table('oauth_clients', function (Blueprint $table) {
|
||||
$table->string('provider')->after('secret')->nullable();
|
||||
});
|
||||
} else {
|
||||
Schema::table('oauth_clients', function (Blueprint $table) {
|
||||
$table->string('provider')->after('secret')->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,9 +33,10 @@ class AddProviderToOauthTable extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('oauth_clients', function (Blueprint $table) {
|
||||
$table->dropColumn('provider');
|
||||
});
|
||||
|
||||
if (Schema::hasColumn('oauth_clients', 'provider')) {
|
||||
Schema::table('oauth_clients', function (Blueprint $table) {
|
||||
$table->dropColumn('provider');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue