Files
ntspi-app/database/migrations/2023_11_24_110601_create_shedules_table.php
T
2026-03-20 21:47:02 +05:00

38 lines
1.0 KiB
PHP
Executable File

<?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('schedules', function (Blueprint $table) {
$table->id();
// $table->string('title');
$table->boolean('is_zaoch');
$table->text('file');
// $table->text('days');
// $table->string('type');
$table->unsignedBigInteger('educational_group_id');
$table->foreign('educational_group_id')->references('id')->on('educational_groups')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('schedules', function (Blueprint $table) {
$table->dropForeign(['faculty_id']);
});
Schema::dropIfExists('schedules');
}
};