mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-15 01:16:39 +02:00
Fix sqlite 'not null error' during alter table migration
This commit is contained in:
parent
b47e9de4c9
commit
109940c002
@ -16,11 +16,20 @@ class SplitTwofaccountsUriInMultipleColumns extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('twofaccounts', function (Blueprint $table) {
|
$driver = Schema::connection($this->getConnection())->getConnection()->getDriverName();
|
||||||
$table->string('otp_type', 10);
|
|
||||||
$table->text('secret');
|
Schema::table('twofaccounts', function (Blueprint $table) use ($driver) {
|
||||||
$table->string('algorithm', 20);
|
if ('sqlite' === $driver) {
|
||||||
$table->unsignedTinyInteger('digits');
|
$table->string('otp_type', 10)->default('');
|
||||||
|
$table->text('secret')->default('');
|
||||||
|
$table->string('algorithm', 20)->default('');
|
||||||
|
$table->unsignedTinyInteger('digits')->default(6);
|
||||||
|
} else {
|
||||||
|
$table->string('otp_type', 10);
|
||||||
|
$table->text('secret');
|
||||||
|
$table->string('algorithm', 20);
|
||||||
|
$table->unsignedTinyInteger('digits');
|
||||||
|
}
|
||||||
$table->unsignedInteger('period')->nullable();
|
$table->unsignedInteger('period')->nullable();
|
||||||
$table->unsignedBigInteger('counter')->nullable();
|
$table->unsignedBigInteger('counter')->nullable();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user