Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 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 CreateStudentTable extends Migration
  8. {
  9. /**
  10. * Run the migrations.
  11. *
  12. * @return void
  13. */
  14. public function up()
  15. {
  16. Schema::create('student', function (Blueprint $table) {
  17. $table->bigIncrements('id');
  18. $table->string('name',100)->nullable();
  19. $table->string('gender')->nullable();
  20. $table->string('address')->nullable();
  21. $table->string('pictures',255)->nullable();
  22. $table->integer('status');
  23. $table->bigInteger('user_id')->unsigned();
  24. $table->foreign('user_id')->references('id')->on('user')->onDelete('cascade');
  25. //$table->timestamp('login_at');
  26. $table->timestamps(); //will create created_at and updated_at
  27. });
  28. }
  29.  
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('student');
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement