Nenhuma descrição

2020_03_06_122426_create_participating_programs_view.php 800B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateParticipatingProgramsView extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. DB::statement('
  13. CREATE VIEW VIEW_participating_programs
  14. AS
  15. SELECT
  16. programs.id,
  17. programs.name,
  18. programs.is_graduate,
  19. programs.school_id,
  20. courses.semester_id
  21. FROM
  22. programs
  23. JOIN courses ON courses.program_id = programs.id;
  24. ');
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. DB::statement('DROP VIEW IF EXISTS VIEW_participating_programs');
  34. }
  35. }