id(); $table->unsignedBigInteger('user_id')->unique(); $table->string('photo')->nullable(); $table->string('name')->nullable(); $table->string('surname')->nullable(); $table->string('patronymic')->nullable(); $table->unsignedInteger('class_id')->nullable(); $table->string('information_about_me')->nullable(); $table->timestamps(); $table->foreign('user_id') ->references('id')->on('users') ->onDelete('cascade'); $table->foreign('class_id') ->references('id')->on('school_classes') ->onDelete('set null'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('students'); } }