暫無描述

2019_07_07_183013_create_departments_table.php 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateDepartmentsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('departments', function (Blueprint $table) {
  15. $table->unsignedBigInteger('id')->primary();
  16. $table->string('name')->nullable();
  17. $table->string('title')->nullable();
  18. });
  19. // DB::table('departments')->insert(
  20. // array(
  21. // array('id' => '1','name' => 'BIOL', 'title' => 'Biolo'),
  22. // array('id' => '4','name' => 'CIAM', 'title' => ),
  23. // array('id' => '2','name' => 'FISI', 'title' => ),
  24. // array('id' => '3','name' => 'MATE', 'title' => ),
  25. // array('id' => '5','name' => 'PGCN', 'title' => ),
  26. // array('id' => '6','name' => 'QUIM', 'title' => ),
  27. // array('id' => '7','name' => 'default'),
  28. // ));
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('departments');
  38. }
  39. }