fadlyshafa

Untitled

Feb 8th, 2020
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. <?php
  2.  
  3. use Illuminate\Support\Facades\Schema;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Database\Migrations\Migration;
  6.  
  7. class CreateBiodata extends Migration
  8. {
  9.     /**
  10.      * Run the migrations.
  11.      *
  12.      * @return void
  13.      */
  14.     public function up()
  15.     {
  16.         Schema::create('biodata', function (Blueprint $table) {
  17.             $table->increments('id');
  18.             $table->bigInteger('users')->unsigned();
  19.             $table->string('no_hp',15);
  20.             $table->text('alamat');
  21.             $table->string('tempat_lahir',255);
  22.             $table->datetime('tanggal_lahir');
  23.             $table->timestamps();
  24.  
  25.             $table->foreign('users')->references('id')->on('users')->onDelete('cascade');
  26.  
  27.             $table->engine = 'InnoDB';
  28.         });
  29.     }
  30.  
  31.     /**
  32.      * Reverse the migrations.
  33.      *
  34.      * @return void
  35.      */
  36.     public function down()
  37.     {
  38.         Schema::table('biodata', function (Blueprint $table) {
  39.             //
  40.         });
  41.     }
  42. }
Add Comment
Please, Sign In to add comment