暫無描述

2021_04_25_194120_create_ta_course_table.php 797B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateTaCourseTable extends Migration
  5. {
  6. /**
  7. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. Schema::create('ta_course', function (Blueprint $table) {
  14. $table->increments('id');
  15. $table->integer('ta_id')->unsigned();
  16. $table->foreign('ta_id')
  17. ->references('id')
  18. ->on('transformative_actions')
  19. ->onDelete('cascade')
  20. ->onUpdate('cascade');
  21. $table->integer('course_id')->unsigned();
  22. $table->foreign('course_id')
  23. ->references('id')
  24. ->on('courses')
  25. ->onDelete('cascade')
  26. ->onUpdate('cascade');
  27. });
  28. }
  29. /**
  30. * Reverse the migrations.
  31. *
  32. * @return void
  33. */
  34. public function down()
  35. {
  36. Schema::drop('ta_course');
  37. }
  38. }