From f80b48f8ff5ed55c04e78bc94a3dd0c5136cff5a Mon Sep 17 00:00:00 2001 From: IanM <16573496+imorland@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:24:15 +0000 Subject: [PATCH] perf: add index to posts.ip_address (#33) * perf: add index to posts.ip_address * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot --- ...y_posts_add_index_to_ip_address_column.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 migrations/2023_11_27_000000_modify_posts_add_index_to_ip_address_column.php diff --git a/migrations/2023_11_27_000000_modify_posts_add_index_to_ip_address_column.php b/migrations/2023_11_27_000000_modify_posts_add_index_to_ip_address_column.php new file mode 100644 index 0000000..1941b32 --- /dev/null +++ b/migrations/2023_11_27_000000_modify_posts_add_index_to_ip_address_column.php @@ -0,0 +1,28 @@ + function (Builder $schema) { + $schema->table('posts', function (Blueprint $table) { + $table->index('ip_address'); + $table->index(['user_id', 'ip_address']); + }); + }, + 'down' => function (Builder $schema) { + $schema->table('posts', function (Blueprint $table) { + $table->dropIndex(['ip_address']); + $table->dropIndex(['user_id', 'ip_address']); + }); + }, +];