Sin descripción

2019_07_07_183013_create_departments_table.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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');
  17. });
  18. DB::table('departments')->insert(
  19. array(
  20. array('id' => '0','name' => 'default'),
  21. array('id' => '1','name' => 'BIOL'),
  22. array('id' => '4','name' => 'CIAM'),
  23. array('id' => '2','name' => 'FISI'),
  24. array('id' => '3','name' => 'MATE'),
  25. array('id' => '5','name' => 'PGCN'),
  26. array('id' => '6','name' => 'QUIM')
  27. ));
  28. }
  29. /**
  30. * Reverse the migrations.
  31. *
  32. * @return void
  33. */
  34. public function down()
  35. {
  36. Schema::dropIfExists('departments');
  37. }
  38. }