Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Support\Facades\DB;
  5.  
  6. class ChangePageTable extends Migration
  7. {
  8. /**
  9. * Run the migrations.
  10. *
  11. * @return void
  12. */
  13. public function up()
  14. {
  15. DB::statement("ALTER TABLE pages CHANGE COLUMN type_page type_page ENUM('news', 'article', 'other') NOT NULL DEFAULT 'news'");
  16. }
  17.  
  18. /**
  19. * Reverse the migrations.
  20. *
  21. * @return void
  22. */
  23. public function down()
  24. {
  25. DB::statement("ALTER TABLE pages CHANGE COLUMN type_page type_page ENUM('news', 'article') NOT NULL DEFAULT 'news'");
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement