2024_02_23_122917_create_tasks_table.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. */
  10. public function up(): void
  11. {
  12. Schema::create('tasks', function (Blueprint $table) {
  13. $table->id();
  14. $table->string("name", 150);
  15. $table->integer("project_id");
  16. $table->integer("company_id");
  17. $table->integer("requirement_id")->nullable();
  18. $table->integer("naming_rule_id")->nullable();
  19. $table->integer("parent_id");
  20. $table->string("task_type", 50)->nullable();
  21. $table->string("doc_stage", 50)->nullable();
  22. $table->string("doc_type", 50)->nullable();
  23. $table->string("status")->default('wait')->comment('wait,doing,done,pause,cancel,closed');
  24. $table->integer("assign")->nullable();
  25. $table->text("description")->nullable();
  26. $table->date("begin")->nullable();
  27. $table->date("end")->nullable();
  28. $table->json('mailto')->nullable();
  29. $table->string('email_subject')->nullable();
  30. $table->string('acl')->default('private')->comment('private,custom');
  31. $table->string("whitelist")->nullable();
  32. $table->integer('closed_by')->nullable();
  33. $table->dateTime("closed_at")->nullable();
  34. $table->integer('canceled_by')->nullable();
  35. $table->dateTime("canceled_at")->nullable();
  36. $table->integer('approve_by')->nullable();
  37. $table->dateTime("approve_at")->nullable();
  38. $table->integer('finished_by')->nullable();
  39. $table->dateTime("finished_at")->nullable();
  40. $table->integer('review_by')->nullable();
  41. $table->dateTime("review_at")->nullable();
  42. $table->integer('created_by')->nullable();
  43. $table->json("custom_fields")->nullable();
  44. $table->softDeletes();
  45. $table->timestamps();
  46. });
  47. }
  48. /**
  49. * Reverse the migrations.
  50. */
  51. public function down(): void
  52. {
  53. Schema::dropIfExists('tasks');
  54. }
  55. };