Advertisement
CHaNStar

15

Apr 7th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <?php
  2.  
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Support\Facades\Schema;
  6.  
  7. class CreateTableKelas extends Migration
  8. {
  9. /**
  10. * Run the migrations.
  11. *
  12. * @return void
  13. */
  14. public function up()
  15. {
  16. Schema::create('kelas', function (Blueprint $table) {
  17. $table->bigIncrements('id_kelas');
  18. $table->string('nama_kelas',15);
  19. $table->string('jurusan',100);
  20. $table->timestamps();
  21. });
  22.  
  23. Schema::table('kelas', function($table) {
  24. $table->string('lokasi_ruangan', 100)->after('jurusan');
  25. });
  26.  
  27. Schema::table('kelas', function($table) {
  28. $table->string('lokasi_ruangan', 50)->change();
  29. $table->string('jurusan', 50)->change();
  30. });
  31.  
  32. Schema::table('kelas', function($table) {
  33. $table->string('wakel', 100)->after('lokasi_ruangan');
  34. });
  35.  
  36. Schema::table('kelas', function($table) {
  37. $table->renameColumn('wakel', 'wali_kelas');
  38. });
  39. }
  40.  
  41. /**
  42. * Reverse the migrations.
  43. *
  44. * @return void
  45. */
  46. public function down()
  47. {
  48. Schema::dropIfExists('kelas');
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement