Differential D2422 Diff 6748 src/database/migrations/2021_03_25_100000_add_signup_code_ip_address.php
Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2021_03_25_100000_add_signup_code_ip_address.php
- This file was added.
<?php | |||||
use Illuminate\Database\Migrations\Migration; | |||||
use Illuminate\Database\Schema\Blueprint; | |||||
use Illuminate\Support\Facades\Schema; | |||||
// phpcs:ignore | |||||
class AddSignupCodeIpAddress extends Migration | |||||
{ | |||||
/** | |||||
* Run the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function up() | |||||
{ | |||||
Schema::table( | |||||
'signup_codes', | |||||
function (Blueprint $table) { | |||||
$table->softDeletes(); | |||||
$table->timestamp('created_at')->useCurrent(); | |||||
$table->string('ip_address')->nullable(); | |||||
$table->index(['created_at', 'ip_address']); | |||||
} | |||||
); | |||||
} | |||||
/** | |||||
* Reverse the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function down() | |||||
{ | |||||
Schema::table( | |||||
'signup_codes', | |||||
function (Blueprint $table) { | |||||
$table->dropColumn('created_at'); | |||||
$table->dropColumn('deleted_at'); | |||||
$table->dropColumn('ip_address'); | |||||
} | |||||
); | |||||
} | |||||
} |