forked from eatvio/eatvio-infra
43 lines
993 B
PHP
43 lines
993 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('diaries', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('user_id')
|
|
->nullable()
|
|
->constrained()
|
|
->onUpdate('cascade')
|
|
->onDelete('cascade');
|
|
/* $table->unsignedBigInteger('user_id'); */
|
|
$table->date('date');
|
|
$table->time('wakeup');
|
|
$table->time('retire');
|
|
$table->timestamps();
|
|
/* $table->foreign('user_id')->references('id')->on('users'); */
|
|
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('diaries');
|
|
}
|
|
};
|