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']); + }); + }, +];