2018_06_01_143602_create_operation_log_table.php 990 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateOperationLogTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('operation_log', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->integer('user_id')->comment('用户uid');
  17. $table->string('action',256)->default('')->comment('请求操作');
  18. $table->string('method',64)->default('')->comment('请求方法');
  19. $table->mediumText('data')->default('')->comment('操作内容');
  20. $table->string('ip',64)->default('')->comment('操作IP');
  21. $table->timestamp('created_at');
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::dropIfExists('operation_log');
  32. }
  33. }