Feuerwehr-eppingen/database/migrations/2018_11_06_163233_create_publication_table.php

39 lines
857 B
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePublicationTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('publications', function (Blueprint $table) {
$table->increments('id');
$table->integer('post_id')->unsigned()->nullable();
$table->foreign('post_id')->references('id')->on('posts')->onDelete('SET NULL');
$table->string('platform', 100);
$table->string('state', 255);
$table->dateTime('date_to_publish')->nullable();
$table->dateTime('published_at')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('publications');
}
}