mirror of
https://github.com/m1ngsama/php.git
synced 2025-12-24 16:01:19 +00:00
Created migrations for communities, posts, comments, votes, and user karma tracking.
25 lines
682 B
PHP
25 lines
682 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('communities', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name')->unique();
|
|
$table->string('slug')->unique();
|
|
$table->text('description')->nullable();
|
|
$table->foreignId('created_by')->constrained('users')->onDelete('cascade');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('communities');
|
|
}
|
|
};
|