mirror of
https://github.com/robonen/education-project.git
synced 2026-03-20 19:04:31 +00:00
42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateParentsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('parents', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->unsignedBigInteger('user_id')->unique();
|
|
$table->string('photo')->nullable();
|
|
$table->string('name')->nullable();
|
|
$table->string('surname')->nullable();
|
|
$table->string('patronymic')->nullable();
|
|
$table->string('information_about_me')->nullable();
|
|
$table->timestamps();
|
|
|
|
$table->foreign('user_id')
|
|
->references('id')->on('users')
|
|
->onDelete('cascade');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('parents');
|
|
}
|
|
}
|