Split migration into two to prevent sqlite issue

This commit is contained in:
Bubka 2022-04-04 16:04:13 +02:00
parent 7932228e71
commit 1c9c6f2703
2 changed files with 37 additions and 1 deletions

View File

@ -19,7 +19,6 @@ public function up()
Schema::table('twofaccounts', function (Blueprint $table) { Schema::table('twofaccounts', function (Blueprint $table) {
$table->text('account')->change(); $table->text('account')->change();
$table->text('uri')->change();
}); });
} }
} }

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterEncryptedColumnsToTextForSqliteBis extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$driver = Schema::connection($this->getConnection())->getConnection()->getDriverName();
if ('sqlite' === $driver) {
Schema::table('twofaccounts', function (Blueprint $table) {
$table->text('uri')->change();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('twofaccounts', function (Blueprint $table) {
//
});
}
}