Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Illuminate\Support\Facades\Schema;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class CreateStudentTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('student', function (Blueprint $table) {
- $table->bigIncrements('id');
- $table->string('name',100)->nullable();
- $table->string('gender')->nullable();
- $table->string('address')->nullable();
- $table->string('pictures',255)->nullable();
- $table->integer('status');
- $table->bigInteger('user_id')->unsigned();
- $table->foreign('user_id')->references('id')->on('user')->onDelete('cascade');
- //$table->timestamp('login_at');
- $table->timestamps(); //will create created_at and updated_at
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('student');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement