faiz14

CreateTeachersTable

Jun 24th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 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 CreateTeachersTable extends Migration
  8. {
  9.     /**
  10.      * Run the migrations.
  11.      *
  12.      * @return void
  13.      */
  14.     public function up()
  15.     {
  16.         Schema::create('teachers', function (Blueprint $table) {
  17.             $table->id();
  18.             $table->string('name', 300);
  19.             $table->string('nik', 16)->unique();
  20.             $table->string('birth_place');
  21.             $table->date('birth_date');
  22.             $table->enum('gender', ['L', 'P']);
  23.             $table->string('father');
  24.             $table->string('mother');
  25.             $table->text('address');
  26.             $table->string('phone');
  27.             $table->string('email')->unique();
  28.             $table->string('nuptk');
  29.             $table->string('last_collage');
  30.             $table->timestamps();
  31.         });
  32.     }
  33.  
  34.     /**
  35.      * Reverse the migrations.
  36.      *
  37.      * @return void
  38.      */
  39.     public function down()
  40.     {
  41.         Schema::dropIfExists('teachers');
  42.     }
  43. }
Add Comment
Please, Sign In to add comment