You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.5 KiB

  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateActivitiesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('activities', function (Blueprint $table) {
  15. $table->id();
  16. $table->unsignedBigInteger('business_id');
  17. $table->unsignedBigInteger('project_id')->nullable();
  18. $table->unsignedBigInteger('system_id')->nullable();
  19. $table->unsignedBigInteger('workflow_id')->nullable();
  20. $table->unsignedBigInteger('status_id')->nullable();
  21. $table->unsignedBigInteger('sprint_id')->nullable();
  22. $table->unsignedBigInteger('task_id')->nullable();
  23. $table->unsignedBigInteger('subject_id')->nullable();//row id
  24. $table->unsignedBigInteger('actor_id');
  25. $table->unsignedBigInteger('user_id')->nullable();
  26. $table->unsignedBigInteger('crud_id')->nullable();
  27. $table->unsignedBigInteger('table_id')->nullable();
  28. $table->json('original')->nullable(); // a unique identifier that represent the type of action
  29. $table->json('diff')->nullable(); // all data that has been changed
  30. $table->timestamps();
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::dropIfExists('activities');
  41. }
  42. }