%PDF- %PDF-
| Direktori : /home/vacivi36/core/database/migrations/ |
| Current File : /home/vacivi36/core/database/migrations/2024_10_31_000006_create_schedules_table.php |
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSchedulesTable extends Migration
{
public function up()
{
Schema::create('schedules', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('patient_id');
$table->date('schedule_date'); // Data de agendamento principal
$table->text('notes')->nullable(); // Observações sobre o agendamento
$table->timestamps();
$table->softDeletes();
// Chave estrangeira para paciente
$table->foreign('patient_id')->references('id')->on('patients')->onDelete('restrict');
});
}
public function down()
{
Schema::dropIfExists('schedules');
}
}