dars/database/migrations/2025_11_10_220818_create_students_table.php

33 lines
739 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.
*/
public function up(): void
{
Schema::create('students', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('name');
$table->string('last_name');
$table->foreignId(['group_id']);
$table->foreignId(['class_id']);
$table->integer('points');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('students');
}
};