暫無描述

2021_06_04_003757_create_activities_table.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateActivitiesTable extends Migration
  5. {
  6. public function up()
  7. {
  8. Schema::create('activities', function (Blueprint $table) {
  9. $table->increments('id');
  10. $table->string('name');
  11. $table->string('description');
  12. $table->integer('course_id')->unsigned()->nullable();
  13. $table->timestamps();
  14. //$table->text('criteria_achieved')->nullable();
  15. //$table->text('criteria_weights')->nullable();
  16. //$table->text('outcomes_achieved')->nullable();
  17. //$table->text('outcomes_attempted')->nullable();
  18. $table->text('assessment_comments')->nullable();
  19. //$table->text('transforming_actions')->nullable();
  20. //$table->text('criteria_achieved_percentage')->nullable();
  21. $table->date('date');
  22. $table->boolean('draft')->default(0);
  23. //$table->text('criteria_participant_count')->nullable();
  24. //$table->text('criteria_achiever_count')->nullable();
  25. DB::statement('SET FOREIGN_KEY_CHECKS=1;');
  26. });
  27. Schema::table('activities', function (Blueprint $table) {
  28. $table->foreign('course_id')->references('id')->on('courses')->onDelete('cascade')->onUpdate('cascade');
  29. });
  30. }
  31. /**
  32. * Reverse the migrations.
  33. *
  34. * @return void
  35. */
  36. public function down()
  37. {
  38. Schema::drop('activities');
  39. }
  40. }