설명 없음

2014_10_05_055013_create_programs_table.php 803B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateProgramsTable extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. Schema::create('programs', function(Blueprint $table)
  13. {
  14. $table->engine = 'InnoDB';
  15. $table->increments('id');
  16. $table->string('name', 50);
  17. $table->integer('school_id')->unsigned();
  18. $table->boolean('restrict_rubrics')->default(false);
  19. $table->timestamps();
  20. });
  21. Schema::table('programs', function(Blueprint $table)
  22. {
  23. $table->foreign('school_id')->references('id')->on('schools')->onDelete('cascade')->onUpdate('cascade');
  24. });
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::drop('programs');
  34. }
  35. }