uuid('id')->primary(); $table->uuid('workspace_id'); $table->uuid('user_id'); $table->string('status')->default('draft'); $table->boolean('synced'); $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')->cascadeOnDelete(); $table->index(['workspace_id', 'status', 'scheduled_at']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('posts'); } };