mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-25 03:35:35 +00:00
36 lines
757 B
PHP
36 lines
757 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class AddColumnIpIntoActivities extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::table('activities', function (Blueprint $table) {
|
|
$table->string('ip', 45)->after('user_id');
|
|
|
|
$table->index(['ip'], 'user_ip_idx');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::table('activities', function (Blueprint $table) {
|
|
$table->dropIndex('user_ip_idx');
|
|
$table->dropColumn('ip');
|
|
});
|
|
}
|
|
}
|