Keine Beschreibung

2021_02_17_190118_create_typ_parts_table.php 975B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateTypPartsTable extends Migration
  5. {
  6. /**
  7. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. Schema::create('typ_parts', function (Blueprint $table) {
  14. $table->increments('id')->unsigned();
  15. $table->integer('three_year_plan_id')->unsigned();
  16. $table
  17. ->foreign('three_year_plan_id')
  18. ->references('id')
  19. ->on('three_year_plans')
  20. ->onDelete('cascade')
  21. ->onUpdate('cascade');
  22. $table->integer('semester_id')->unsigned();
  23. $table
  24. ->foreign('semester_id')
  25. ->references('id')
  26. ->on('semesters')
  27. ->onDelete('cascade')
  28. ->onUpdate('cascade');
  29. $table->timestamps();
  30. });
  31. // DB::statement("ALTER TABLE `typ_parts` comment 'Annual plans that are part of a three-year plan'");
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::drop('typ_parts');
  41. }
  42. }