From a7d88b8c47358d7e16bd8882c28db3ace32e39fa Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sat, 17 Jan 2026 12:38:54 -0300 Subject: [PATCH] feat: Implement soft deletes for workspace hashtags and labels, and integrate content_type into the initial post platforms table creation. --- app/Models/WorkspaceHashtag.php | 3 +- app/Models/WorkspaceLabel.php | 3 +- ..._14_232319_create_post_platforms_table.php | 1 + ...d_content_type_to_post_platforms_table.php | 28 ------------------- ...152319_create_workspace_hashtags_table.php | 1 + ...7_153347_create_workspace_labels_table.php | 1 + 6 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 database/migrations/2026_01_17_150140_add_content_type_to_post_platforms_table.php diff --git a/app/Models/WorkspaceHashtag.php b/app/Models/WorkspaceHashtag.php index 5f4f2bec..269129d1 100644 --- a/app/Models/WorkspaceHashtag.php +++ b/app/Models/WorkspaceHashtag.php @@ -6,11 +6,12 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\SoftDeletes; class WorkspaceHashtag extends Model { /** @use HasFactory<\Database\Factories\WorkspaceHashtagFactory> */ - use HasFactory, HasUuids; + use HasFactory, HasUuids, SoftDeletes; protected $fillable = [ 'workspace_id', diff --git a/app/Models/WorkspaceLabel.php b/app/Models/WorkspaceLabel.php index 72a08a2e..20f1323a 100644 --- a/app/Models/WorkspaceLabel.php +++ b/app/Models/WorkspaceLabel.php @@ -6,11 +6,12 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\SoftDeletes; class WorkspaceLabel extends Model { /** @use HasFactory<\Database\Factories\WorkspaceLabelFactory> */ - use HasFactory, HasUuids; + use HasFactory, HasUuids, SoftDeletes; protected $fillable = [ 'workspace_id', diff --git a/database/migrations/2026_01_14_232319_create_post_platforms_table.php b/database/migrations/2026_01_14_232319_create_post_platforms_table.php index 093a8009..01bd10ff 100644 --- a/database/migrations/2026_01_14_232319_create_post_platforms_table.php +++ b/database/migrations/2026_01_14_232319_create_post_platforms_table.php @@ -17,6 +17,7 @@ public function up(): void $table->uuid('social_account_id'); $table->string('platform'); $table->text('content')->nullable(); + $table->string('content_type'); $table->string('status')->default('pending'); $table->string('platform_post_id')->nullable(); $table->boolean('enabled'); diff --git a/database/migrations/2026_01_17_150140_add_content_type_to_post_platforms_table.php b/database/migrations/2026_01_17_150140_add_content_type_to_post_platforms_table.php deleted file mode 100644 index 666b67d1..00000000 --- a/database/migrations/2026_01_17_150140_add_content_type_to_post_platforms_table.php +++ /dev/null @@ -1,28 +0,0 @@ -string('content_type')->nullable()->after('content'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('post_platforms', function (Blueprint $table) { - $table->dropColumn('content_type'); - }); - } -}; diff --git a/database/migrations/2026_01_17_152319_create_workspace_hashtags_table.php b/database/migrations/2026_01_17_152319_create_workspace_hashtags_table.php index c0803b9b..c5f025c8 100644 --- a/database/migrations/2026_01_17_152319_create_workspace_hashtags_table.php +++ b/database/migrations/2026_01_17_152319_create_workspace_hashtags_table.php @@ -17,6 +17,7 @@ public function up(): void $table->string('name'); $table->text('hashtags'); $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2026_01_17_153347_create_workspace_labels_table.php b/database/migrations/2026_01_17_153347_create_workspace_labels_table.php index 7789f28b..49919102 100644 --- a/database/migrations/2026_01_17_153347_create_workspace_labels_table.php +++ b/database/migrations/2026_01_17_153347_create_workspace_labels_table.php @@ -17,6 +17,7 @@ public function up(): void $table->string('name'); $table->string('color', 7); $table->timestamps(); + $table->softDeletes(); }); }