2016-10-29 05:50:55 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
2021-06-10 13:15:52 -07:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
2016-10-29 05:50:55 -07:00
|
|
|
|
|
|
|
class Enable2faFields extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::table('settings', function ($table) {
|
|
|
|
$table->tinyInteger('two_factor_enabled')->nullable()->default(null);
|
|
|
|
});
|
|
|
|
|
|
|
|
Schema::table('users', function ($table) {
|
|
|
|
$table->string('two_factor_secret', 32)->nullable()->default(null);
|
|
|
|
$table->boolean('two_factor_enrolled')->default(0);
|
|
|
|
$table->boolean('two_factor_optin')->default(0);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::table('settings', function ($table) {
|
|
|
|
$table->dropColumn('two_factor_enabled');
|
|
|
|
});
|
|
|
|
|
|
|
|
Schema::table('users', function ($table) {
|
|
|
|
$table->dropColumn('two_factor_secret');
|
|
|
|
$table->dropColumn('two_factor_enrolled');
|
|
|
|
$table->dropColumn('two_factor_optin');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|