Files
Website/database/migrations/2022_12_28_113117_create_posts_table.php
2023-05-24 21:33:17 +00:00

34 lines
816 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.
*/
public function up(): void
{
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();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('posts');
}
};