uuid('id')->primary(); $table->uuid('workspace_id'); $table->uuid('user_id')->nullable(); $table->text('content')->nullable(); $table->json('media')->nullable()->default(null); $table->string('status')->default('draft'); $table->timestamp('scheduled_at')->nullable(); $table->timestamp('published_at')->nullable(); $table->timestamps(); $table->foreign('workspace_id')->references('id')->on('workspaces')->cascadeOnDelete(); $table->foreign('user_id')->references('id')->on('users')->nullOnDelete(); $table->index(['workspace_id', 'status', 'scheduled_at']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('posts'); } };