ldc-com-app-bo/database/migrations/2021_01_15_102147_documents_table.php
Vincent BRIDIER f01e1501b4 init
2021-01-15 14:47:59 +01:00

41 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class DocumentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('documents', function (Blueprint $table) {
$table->bigIncrements('id');
$table->char('uuid', 36);
$table->string('title');
$table->string('type', 3);
$table->unsignedBigInteger('directory');
$table->foreign('directory')->references('id')->on('directories');
$table->string('path');
$table->string('lang');
$table->tinyInteger('published');
$table->unsignedBigInteger('parent')->nullable();
$table->foreign('parent')->references('id')->on('documents');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('documents');
}
}