snipe-it/database/migrations/2016_10_29_002724_enable_2fa_fields.php
snipe cea255995c Fixes #106 - adds Google Authenticator support (#2842)
* refactor to clean up LDAP login, and make the login method easier to handle.

* Login refactor cleanup

* Google 2FA package

* Adds Google Authenticator two-factor

* Removed unused blade

* Added optin setting in profile

* Removed dumb comments

* Made lock_passwords check more consistent

* Additional two factor strings

* Lock passwords check

* Display feature disabled text if in demo mode

* Two factor admin reset options

* Translation strings
2016-10-29 05:50:55 -07:00

44 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
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');
});
}
}