diff --git a/database/migrations/2020_08_16_035000_add_index_to_urls_table.php b/database/migrations/2020_08_16_035000_add_index_to_urls_table.php new file mode 100644 index 00000000..5e855e38 --- /dev/null +++ b/database/migrations/2020_08_16_035000_add_index_to_urls_table.php @@ -0,0 +1,34 @@ +index('short_url'); + $table->index('user_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('urls', function (Blueprint $table) { + $table->dropIndex('short_url'); + $table->dropIndex('user_id'); + }); + } +} diff --git a/database/migrations/2020_08_16_035242_add_index_to_clicks_table.php b/database/migrations/2020_08_16_035242_add_index_to_clicks_table.php new file mode 100644 index 00000000..fa0c33ec --- /dev/null +++ b/database/migrations/2020_08_16_035242_add_index_to_clicks_table.php @@ -0,0 +1,32 @@ +index('short_url'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('clicks', function (Blueprint $table) { + $table->dropIndex('short_url'); + }); + } +}