Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create beatmap descriptions forum in forum seeder #11833

Merged
merged 3 commits into from
Feb 5, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion database/seeders/ModelSeeders/ForumSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ public function run(): void
'forum_id' => $GLOBALS['cfg']['osu']['forum']['admin_forum_id'],
'forum_name' => 'Management',
]);
Forum::factory()
->closed()
->has(
Forum::factory()->state([
'forum_desc' => '',
'forum_id' => $GLOBALS['cfg']['osu']['forum']['beatmap_description_forum_id'],
'forum_name' => 'Beatmap Threads',
]),
'subforums',
)
->create([
'forum_desc' => '',
'forum_name' => 'Beatmaps',
]);

// Other forums
Forum::factory()
Expand All @@ -81,7 +95,10 @@ public function run(): void

// Forums to be populated, i.e. all open forums except "User Pages"
$forums = Forum::where('forum_type', 1)
->where('forum_id', '<>', $GLOBALS['cfg']['osu']['user']['user_page_forum_id'])
->where([
['forum_id', '<>', $GLOBALS['cfg']['osu']['user']['user_page_forum_id']],
['forum_id', '<>', $GLOBALS['cfg']['osu']['forum']['beatmap_description_forum_id']],
])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
->where([
['forum_id', '<>', $GLOBALS['cfg']['osu']['user']['user_page_forum_id']],
['forum_id', '<>', $GLOBALS['cfg']['osu']['forum']['beatmap_description_forum_id']],
])
->whereNotIn('forum_id', [
$GLOBALS['cfg']['osu']['user']['user_page_forum_id'],
$GLOBALS['cfg']['osu']['forum']['beatmap_description_forum_id'],
])

->get();

// Topics and posts
Expand Down