-
-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: store message mentions for better performance (#4079)
- Loading branch information
Showing
23 changed files
with
272 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...sions/messages/migrations/2024_10_19_000000_create_dialog_message_mentions_user_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Flarum. | ||
* | ||
* For detailed copyright and license information, please view the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
use Flarum\Database\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
return Migration::createTable( | ||
'dialog_message_mentions_user', | ||
function (Blueprint $table) { | ||
$table->unsignedInteger('dialog_message_id'); | ||
$table->unsignedInteger('mentions_user_id'); | ||
$table->dateTime('created_at')->nullable()->useCurrent(); | ||
|
||
$table->primary(['dialog_message_id', 'mentions_user_id']); | ||
$table->foreign('dialog_message_id')->references('id')->on('dialog_messages')->cascadeOnDelete(); | ||
$table->foreign('mentions_user_id')->references('id')->on('users')->cascadeOnDelete(); | ||
} | ||
); |
24 changes: 24 additions & 0 deletions
24
...sions/messages/migrations/2024_10_19_000001_create_dialog_message_mentions_post_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Flarum. | ||
* | ||
* For detailed copyright and license information, please view the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
use Flarum\Database\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
return Migration::createTable( | ||
'dialog_message_mentions_post', | ||
function (Blueprint $table) { | ||
$table->unsignedInteger('dialog_message_id'); | ||
$table->unsignedInteger('mentions_post_id'); | ||
$table->dateTime('created_at')->nullable()->useCurrent(); | ||
|
||
$table->primary(['dialog_message_id', 'mentions_post_id']); | ||
$table->foreign('dialog_message_id')->references('id')->on('dialog_messages')->cascadeOnDelete(); | ||
$table->foreign('mentions_post_id')->references('id')->on('posts')->cascadeOnDelete(); | ||
} | ||
); |
24 changes: 24 additions & 0 deletions
24
...ions/messages/migrations/2024_10_19_000002_create_dialog_message_mentions_group_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Flarum. | ||
* | ||
* For detailed copyright and license information, please view the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
use Flarum\Database\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
return Migration::createTable( | ||
'dialog_message_mentions_group', | ||
function (Blueprint $table) { | ||
$table->unsignedInteger('dialog_message_id'); | ||
$table->unsignedInteger('mentions_group_id'); | ||
$table->dateTime('created_at')->nullable()->useCurrent(); | ||
|
||
$table->primary(['dialog_message_id', 'mentions_group_id']); | ||
$table->foreign('dialog_message_id')->references('id')->on('dialog_messages')->cascadeOnDelete(); | ||
$table->foreign('mentions_group_id')->references('id')->on('groups')->cascadeOnDelete(); | ||
} | ||
); |
24 changes: 24 additions & 0 deletions
24
...nsions/messages/migrations/2024_10_19_000002_create_dialog_message_mentions_tag_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Flarum. | ||
* | ||
* For detailed copyright and license information, please view the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
use Flarum\Database\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
return Migration::createTable( | ||
'dialog_message_mentions_tag', | ||
function (Blueprint $table) { | ||
$table->unsignedInteger('dialog_message_id'); | ||
$table->unsignedInteger('mentions_tag_id'); | ||
$table->dateTime('created_at')->nullable()->useCurrent(); | ||
|
||
$table->primary(['dialog_message_id', 'mentions_tag_id']); | ||
$table->foreign('dialog_message_id')->references('id')->on('dialog_messages')->cascadeOnDelete(); | ||
$table->foreign('mentions_tag_id')->references('id')->on('tags')->cascadeOnDelete(); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.