1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Merge branch 'log-ip-address' of https://github.com/johnroyer/BookStack into johnroyer-log-ip-address

This commit is contained in:
Dan Brown
2021-09-26 16:17:28 +01:00
4 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<?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');
});
}
}