1
0
mirror of https://github.com/robonen/education-project.git synced 2026-03-20 02:44:31 +00:00
Files
education-project/database/migrations/2020_12_14_170701_create_news_table.php
2020-12-15 16:35:50 +07:00

38 lines
844 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('news', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('description');
$table->string('photo_uri')->nullable();
$table->unsignedInteger('headteacher_id');
$table->foreign('headteacher_id')->references('id')->on('head_teachers');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('news');
}
}