Files
Website/database/migrations/2022_12_28_113117_create_posts_table.php
2023-01-24 15:13:03 +10:00

40 lines
933 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.
*
* @return void
*/
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('slug', 255)->unique();
$table->string('title', 255);
$table->timestamp('publish_at')->nullable()->useCurrent();
$table->uuid('user_id');
$table->uuid('hero');
$table->text('content');
$table->timestamps();
// $table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('posts');
}
};