Skip to content

Commit f1c90e9

Browse files
committed
bugfix: update migrations
1 parent 38cb4c1 commit f1c90e9

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

database/migrations/2026_02_14_000001_create_posts_table.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,15 @@ public function up(): void
1616
$table->foreignId('user_id')->constrained()->onDelete('cascade');
1717
$table->string('title');
1818
$table->text('content');
19-
$table->string('status')->default('draft');
20-
$table->timestamps();
21-
22-
// Add indexes for search optimization
23-
$table->index('title');
24-
$table->index('status');
25-
$table->index('created_at');
26-
$table->fullText(['title', 'content']);
27-
});
28-
}
29-
30-
$table->string('title');
31-
$table->text('content');
32-
$table->foreignId('author_id')->constrained('users')->onDelete('cascade');
33-
$table->enum('status', ['draft', 'published', 'archived'])->default('draft');
19+
$table->string('status')->default('draft');
3420
$table->timestamp('published_at')->nullable();
3521
$table->timestamps();
3622
$table->softDeletes();
3723

3824
// Indexes for search performance
3925
$table->index('title');
4026
$table->index('status');
41-
$table->index('author_id');
27+
$table->index('user_id');
4228
$table->index('published_at');
4329
});
4430
}

database/migrations/2026_02_14_000002_create_groups_table.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ public function up(): void
1616
$table->string('name');
1717
$table->text('description')->nullable();
1818
$table->boolean('is_active')->default(true);
19-
$table->timestamps();
20-
21-
// Add indexes for search optimization
22-
$table->index('name');
23-
$table->index('is_active');
24-
$table->fullText(['name', 'description']);
25-
});
26-
}
27-
2819
$table->foreignId('owner_id')->constrained('users')->onDelete('cascade');
2920
$table->enum('type', ['public', 'private', 'restricted'])->default('public');
3021
$table->timestamps();
@@ -34,6 +25,8 @@ public function up(): void
3425
$table->index('name');
3526
$table->index('type');
3627
$table->index('owner_id');
28+
$table->index('is_active');
29+
$table->fullText(['name', 'description']);
3730
});
3831
}
3932

0 commit comments

Comments
 (0)