2020_10_22_083442_create_tasks_table.php 952 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateTasksTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('tasks', function (Blueprint $table) {
  15. $table->id();
  16. $table->string('name', 255);
  17. $table->integer('type_id')->unsigned();
  18. $table->foreign('type_id')->references('id')->on('task_types')->onDelete('cascade');
  19. $table->string('place', 500);
  20. $table->date('date');
  21. $table->time('time');
  22. $table->string('duration');
  23. $table->text('comment');
  24. $table->timestamps();
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('tasks');
  35. }
  36. }