2019_06_03_162603_crate_table_post_log.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CrateTablePostLog extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('post_log', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->integer('uid')
  17. ->index('uid')
  18. ->unsigned()
  19. ->comment('uid');
  20. $table->integer('post_id')
  21. ->index('post_id')
  22. ->comment('内容id');
  23. $table->string('username', 32)
  24. ->default('')
  25. ->comment('操作人');
  26. $table->string('log_type', 32)
  27. ->default('add_data')
  28. ->comment('类型:add_data增加数据');
  29. $table->string('content', 500)
  30. ->default('')
  31. ->comment('内容');
  32. $table->timestamps();
  33. });
  34. }
  35. /**
  36. * Reverse the migrations.
  37. *
  38. * @return void
  39. */
  40. public function down()
  41. {
  42. Schema::dropIfExists('post_log');
  43. }
  44. }