diff --git a/database/migrations/2018_06_11_030049_add_filters_to_media_table.php b/database/migrations/2018_06_11_030049_add_filters_to_media_table.php index dac0a0828..f805593e4 100644 --- a/database/migrations/2018_06_11_030049_add_filters_to_media_table.php +++ b/database/migrations/2018_06_11_030049_add_filters_to_media_table.php @@ -27,7 +27,7 @@ class AddFiltersToMediaTable extends Migration public function down() { Schema::table('media', function (Blueprint $table) { - $table->dropColumn(['filter_name','filter_class']); + $table->dropColumn(['filter_name', 'filter_class']); }); } } diff --git a/database/migrations/2018_07_15_011916_add_2fa_to_users_table.php b/database/migrations/2018_07_15_011916_add_2fa_to_users_table.php index 8cdcc8983..be0e312bf 100644 --- a/database/migrations/2018_07_15_011916_add_2fa_to_users_table.php +++ b/database/migrations/2018_07_15_011916_add_2fa_to_users_table.php @@ -29,7 +29,7 @@ class Add2faToUsersTable extends Migration public function down() { Schema::table('users', function (Blueprint $table) { - $table->dropColumn(['2fa_enabled','2fa_secret','2fa_backup_codes','2fa_setup_at']); + $table->dropColumn(['2fa_enabled', '2fa_secret', '2fa_backup_codes', '2fa_setup_at']); }); } } diff --git a/database/migrations/2018_08_22_022306_update_settings_table.php b/database/migrations/2018_08_22_022306_update_settings_table.php index e42345ec6..5847ab119 100644 --- a/database/migrations/2018_08_22_022306_update_settings_table.php +++ b/database/migrations/2018_08_22_022306_update_settings_table.php @@ -29,7 +29,7 @@ class UpdateSettingsTable extends Migration public function down() { Schema::table('user_settings', function (Blueprint $table) { - $table->dropColumn(['show_profile_followers','show_profile_follower_count','show_profile_following','show_profile_following_count']); + $table->dropColumn(['show_profile_followers', 'show_profile_follower_count', 'show_profile_following', 'show_profile_following_count']); }); } } diff --git a/database/migrations/2018_08_27_004653_update_media_table_add_alt_text.php b/database/migrations/2018_08_27_004653_update_media_table_add_alt_text.php index 272ef90f7..edac0ebe3 100644 --- a/database/migrations/2018_08_27_004653_update_media_table_add_alt_text.php +++ b/database/migrations/2018_08_27_004653_update_media_table_add_alt_text.php @@ -32,7 +32,7 @@ class UpdateMediaTableAddAltText extends Migration public function down() { Schema::table('media', function (Blueprint $table) { - $table->dropColumn(['original_sha256','optimized_sha256','caption','hls_path','hls_transcoded_at','key','metadata']); + $table->dropColumn(['original_sha256', 'optimized_sha256', 'caption', 'hls_path', 'hls_transcoded_at', 'key', 'metadata']); }); } } diff --git a/database/migrations/2018_09_02_042235_create_follow_requests_table.php b/database/migrations/2018_09_02_042235_create_follow_requests_table.php index 0abf52fa8..cff409faf 100644 --- a/database/migrations/2018_09_02_042235_create_follow_requests_table.php +++ b/database/migrations/2018_09_02_042235_create_follow_requests_table.php @@ -1,8 +1,8 @@ dropColumn(['local_profile','local_following']); + $table->dropColumn(['local_profile', 'local_following']); }); } } diff --git a/database/migrations/2018_10_18_035552_update_media_add_alt_text.php b/database/migrations/2018_10_18_035552_update_media_add_alt_text.php index 3ab198ab6..6293538ea 100644 --- a/database/migrations/2018_10_18_035552_update_media_add_alt_text.php +++ b/database/migrations/2018_10_18_035552_update_media_add_alt_text.php @@ -1,8 +1,8 @@ dropColumn(['license','is_nsfw','version','remote_media','remote_url']); + $table->dropColumn(['license', 'is_nsfw', 'version', 'remote_media', 'remote_url']); }); } } diff --git a/database/migrations/2018_10_25_030944_update_profile_table.php b/database/migrations/2018_10_25_030944_update_profile_table.php index a2f40453f..1793580d7 100644 --- a/database/migrations/2018_10_25_030944_update_profile_table.php +++ b/database/migrations/2018_10_25_030944_update_profile_table.php @@ -1,8 +1,8 @@ dropColumn(['verify_token','secret','salmon_url','hub_url']); + $table->dropColumn(['verify_token', 'secret', 'salmon_url', 'hub_url']); }); } - if(Schema::hasColumn('stories', 'bigIncrements')) { + if (Schema::hasColumn('stories', 'bigIncrements')) { Schema::table('stories', function (Blueprint $table) { $table->dropColumn('bigIncrements'); }); diff --git a/database/migrations/2018_12_24_032921_add_delete_after_to_user_table.php b/database/migrations/2018_12_24_032921_add_delete_after_to_user_table.php index 70ea6bd2e..07195c608 100644 --- a/database/migrations/2018_12_24_032921_add_delete_after_to_user_table.php +++ b/database/migrations/2018_12_24_032921_add_delete_after_to_user_table.php @@ -1,8 +1,8 @@ dropColumn(['unlisted','cw','no_autolink']); + $table->dropColumn(['unlisted', 'cw', 'no_autolink']); }); } } diff --git a/database/migrations/2019_01_12_054413_stories.php b/database/migrations/2019_01_12_054413_stories.php index f58a8cf38..a6ab56c31 100644 --- a/database/migrations/2019_01_12_054413_stories.php +++ b/database/migrations/2019_01_12_054413_stories.php @@ -1,8 +1,8 @@ dropColumn(['remote_url','last_fetched_at']); + $table->dropColumn(['remote_url', 'last_fetched_at']); }); } } diff --git a/database/migrations/2019_02_07_004642_create_discover_categories_table.php b/database/migrations/2019_02_07_004642_create_discover_categories_table.php index a0edb65ec..2a49c39ef 100644 --- a/database/migrations/2019_02_07_004642_create_discover_categories_table.php +++ b/database/migrations/2019_02_07_004642_create_discover_categories_table.php @@ -1,8 +1,8 @@ boolean('local_only')->default(true); $table->boolean('public_only')->default(true); $table->boolean('photos_only')->default(true); - $table->timestamp('active_until')->nullable(); + $table->timestamp('active_until')->nullable(); $table->timestamps(); }); } diff --git a/database/migrations/2019_02_07_021214_create_discover_category_hashtags_table.php b/database/migrations/2019_02_07_021214_create_discover_category_hashtags_table.php index ec85477a3..7c25a5301 100644 --- a/database/migrations/2019_02_07_021214_create_discover_category_hashtags_table.php +++ b/database/migrations/2019_02_07_021214_create_discover_category_hashtags_table.php @@ -1,8 +1,8 @@ nullableTimestamps(); }); } + /** * Reverse the migrations. */ diff --git a/database/migrations/2019_02_09_045935_create_circles_table.php b/database/migrations/2019_02_09_045935_create_circles_table.php index 40faf510e..421ef41f8 100644 --- a/database/migrations/2019_02_09_045935_create_circles_table.php +++ b/database/migrations/2019_02_09_045935_create_circles_table.php @@ -1,8 +1,8 @@ index('visibility','statuses_visibility_index'); + $table->index('visibility', 'statuses_visibility_index'); $table->index(['in_reply_to_id', 'reblog_of_id'], 'statuses_in_reply_or_reblog_index'); $table->index('uri', 'statuses_uri_index'); $table->index('is_nsfw', 'statuses_is_nsfw_index'); @@ -24,7 +24,7 @@ class AddIndexes extends Migration }); Schema::table('notifications', function (Blueprint $table) { - $table->index('created_at','notifications_created_at_index'); + $table->index('created_at', 'notifications_created_at_index'); $table->index('actor_id', 'notifications_actor_id_index'); }); diff --git a/database/migrations/2019_02_13_221138_add_soft_delete_indexes.php b/database/migrations/2019_02_13_221138_add_soft_delete_indexes.php index 3795e6b63..4401d857a 100644 --- a/database/migrations/2019_02_13_221138_add_soft_delete_indexes.php +++ b/database/migrations/2019_02_13_221138_add_soft_delete_indexes.php @@ -1,8 +1,8 @@ index('deleted_at','avatars_deleted_at_index'); + $table->index('deleted_at', 'avatars_deleted_at_index'); }); Schema::table('profiles', function (Blueprint $table) { - $table->index('deleted_at','profiles_deleted_at_index'); + $table->index('deleted_at', 'profiles_deleted_at_index'); }); Schema::table('mentions', function (Blueprint $table) { - $table->index('deleted_at','mentions_deleted_at_index'); + $table->index('deleted_at', 'mentions_deleted_at_index'); }); Schema::table('likes', function (Blueprint $table) { - $table->index('deleted_at','likes_deleted_at_index'); + $table->index('deleted_at', 'likes_deleted_at_index'); }); Schema::table('statuses', function (Blueprint $table) { - $table->index('deleted_at','statuses_deleted_at_index'); + $table->index('deleted_at', 'statuses_deleted_at_index'); }); Schema::table('media', function (Blueprint $table) { - $table->index('deleted_at','media_deleted_at_index'); + $table->index('deleted_at', 'media_deleted_at_index'); }); Schema::table('notifications', function (Blueprint $table) { - $table->index('deleted_at','notifications_deleted_at_index'); + $table->index('deleted_at', 'notifications_deleted_at_index'); }); Schema::table('users', function (Blueprint $table) { - $table->index('deleted_at','users_deleted_at_index'); + $table->index('deleted_at', 'users_deleted_at_index'); }); } diff --git a/database/migrations/2019_02_15_033323_create_user_invites_table.php b/database/migrations/2019_02_15_033323_create_user_invites_table.php index 62bfbd5b5..c9fdf7a38 100644 --- a/database/migrations/2019_02_15_033323_create_user_invites_table.php +++ b/database/migrations/2019_02_15_033323_create_user_invites_table.php @@ -1,8 +1,8 @@ dropColumn(['reply_count','comments_disabled']); + $table->dropColumn(['reply_count', 'comments_disabled']); }); } } diff --git a/database/migrations/2019_04_16_184644_add_layout_to_profiles_table.php b/database/migrations/2019_04_16_184644_add_layout_to_profiles_table.php index 17328dea5..bef375a0e 100644 --- a/database/migrations/2019_04_16_184644_add_layout_to_profiles_table.php +++ b/database/migrations/2019_04_16_184644_add_layout_to_profiles_table.php @@ -1,8 +1,8 @@ dropColumn(['profile_layout','post_layout']); + $table->dropColumn(['profile_layout', 'post_layout']); }); } } diff --git a/database/migrations/2019_04_25_200411_add_snowflake_ids_to_collections_table.php b/database/migrations/2019_04_25_200411_add_snowflake_ids_to_collections_table.php index a0e88ce7e..53e9a523a 100644 --- a/database/migrations/2019_04_25_200411_add_snowflake_ids_to_collections_table.php +++ b/database/migrations/2019_04_25_200411_add_snowflake_ids_to_collections_table.php @@ -1,8 +1,8 @@ timestamp('last_fetched_at')->nullable(); - $table->unsignedInteger('status_count')->default(0)->nullable(); - $table->unsignedInteger('followers_count')->default(0)->nullable(); - $table->unsignedInteger('following_count')->default(0)->nullable(); - $table->string('webfinger')->unique()->nullable()->index(); - $table->string('avatar_url')->nullable(); - $table->dropColumn('keybase_proof'); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('profiles', function (Blueprint $table) { + $table->timestamp('last_fetched_at')->nullable(); + $table->unsignedInteger('status_count')->default(0)->nullable(); + $table->unsignedInteger('followers_count')->default(0)->nullable(); + $table->unsignedInteger('following_count')->default(0)->nullable(); + $table->string('webfinger')->unique()->nullable()->index(); + $table->string('avatar_url')->nullable(); + $table->dropColumn('keybase_proof'); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('profiles', function (Blueprint $table) { - $table->dropColumn(['last_fetched_at','status_count','followers_count','following_count','webfinger','avatar_url']); - $table->text('keybase_proof')->nullable()->after('post_layout'); - }); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('profiles', function (Blueprint $table) { + $table->dropColumn(['last_fetched_at', 'status_count', 'followers_count', 'following_count', 'webfinger', 'avatar_url']); + $table->text('keybase_proof')->nullable()->after('post_layout'); + }); + } } diff --git a/database/migrations/2020_08_18_022520_add_remote_url_to_stories_table.php b/database/migrations/2020_08_18_022520_add_remote_url_to_stories_table.php index e1ecdc66a..3a357be33 100644 --- a/database/migrations/2020_08_18_022520_add_remote_url_to_stories_table.php +++ b/database/migrations/2020_08_18_022520_add_remote_url_to_stories_table.php @@ -36,10 +36,10 @@ class AddRemoteUrlToStoriesTable extends Migration public function down() { Schema::table('stories', function (Blueprint $table) { - $table->dropColumn(['remote_url','media_url','is_archived','name']); + $table->dropColumn(['remote_url', 'media_url', 'is_archived', 'name']); }); Schema::table('media', function (Blueprint $table) { - $table->dropColumn(['blurhash','srcset','width','height']); + $table->dropColumn(['blurhash', 'srcset', 'width', 'height']); }); } } diff --git a/database/migrations/2020_11_14_221947_add_type_to_direct_messages_table.php b/database/migrations/2020_11_14_221947_add_type_to_direct_messages_table.php index cffb29d12..0bbdd420d 100644 --- a/database/migrations/2020_11_14_221947_add_type_to_direct_messages_table.php +++ b/database/migrations/2020_11_14_221947_add_type_to_direct_messages_table.php @@ -6,29 +6,29 @@ use Illuminate\Support\Facades\Schema; class AddTypeToDirectMessagesTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::table('direct_messages', function (Blueprint $table) { - $table->string('type')->default('text')->nullable()->index()->after('from_id'); - $table->boolean('is_hidden')->default(false)->index()->after('group_message'); - $table->json('meta')->nullable()->after('is_hidden'); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('direct_messages', function (Blueprint $table) { + $table->string('type')->default('text')->nullable()->index()->after('from_id'); + $table->boolean('is_hidden')->default(false)->index()->after('group_message'); + $table->json('meta')->nullable()->after('is_hidden'); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('direct_messages', function (Blueprint $table) { - $table->dropColumn(['type','is_hidden','meta']); - }); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('direct_messages', function (Blueprint $table) { + $table->dropColumn(['type', 'is_hidden', 'meta']); + }); + } } diff --git a/database/migrations/2020_12_03_050018_create_account_interstitials_table.php b/database/migrations/2020_12_03_050018_create_account_interstitials_table.php index 0b0e8862c..c4506f333 100644 --- a/database/migrations/2020_12_03_050018_create_account_interstitials_table.php +++ b/database/migrations/2020_12_03_050018_create_account_interstitials_table.php @@ -33,7 +33,7 @@ class CreateAccountInterstitialsTable extends Migration $table->timestamps(); }); - Schema::table('users', function(Blueprint $table) { + Schema::table('users', function (Blueprint $table) { $table->boolean('has_interstitial')->default(false)->index(); }); } diff --git a/database/migrations/2020_12_13_203646_add_providers_column_to_oauth_clients_table.php b/database/migrations/2020_12_13_203646_add_providers_column_to_oauth_clients_table.php index 6c828b24d..3b518b565 100644 --- a/database/migrations/2020_12_13_203646_add_providers_column_to_oauth_clients_table.php +++ b/database/migrations/2020_12_13_203646_add_providers_column_to_oauth_clients_table.php @@ -14,7 +14,7 @@ class AddProvidersColumnToOauthClientsTable extends Migration public function up() { Schema::table('oauth_clients', function (Blueprint $table) { - if(Schema::hasTable('oauth_clients') && Schema::hasColumn('oauth_clients', 'provider') == false) { + if (Schema::hasTable('oauth_clients') && Schema::hasColumn('oauth_clients', 'provider') == false) { $table->string('provider')->after('secret')->nullable(); } }); @@ -27,10 +27,10 @@ class AddProvidersColumnToOauthClientsTable extends Migration */ public function down() { - if(Schema::hasTable('oauth_clients')) { - Schema::table('oauth_clients', function (Blueprint $table) { - $table->dropColumn('provider'); - }); - } + if (Schema::hasTable('oauth_clients')) { + Schema::table('oauth_clients', function (Blueprint $table) { + $table->dropColumn('provider'); + }); + } } } diff --git a/database/migrations/2020_12_25_220825_add_status_profile_id_to_likes_table.php b/database/migrations/2020_12_25_220825_add_status_profile_id_to_likes_table.php index ba35157fa..e885898ba 100644 --- a/database/migrations/2020_12_25_220825_add_status_profile_id_to_likes_table.php +++ b/database/migrations/2020_12_25_220825_add_status_profile_id_to_likes_table.php @@ -6,30 +6,30 @@ use Illuminate\Support\Facades\Schema; class AddStatusProfileIdToLikesTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::table('likes', function (Blueprint $table) { - $table->bigInteger('status_profile_id')->nullable()->unsigned()->index()->after('status_id'); - $table->boolean('is_comment')->nullable()->index()->after('status_profile_id'); - $table->dropColumn('flagged'); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('likes', function (Blueprint $table) { + $table->bigInteger('status_profile_id')->nullable()->unsigned()->index()->after('status_id'); + $table->boolean('is_comment')->nullable()->index()->after('status_profile_id'); + $table->dropColumn('flagged'); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('likes', function (Blueprint $table) { - $table->dropColumn(['status_profile_id','is_comment']); - $table->boolean('flagged')->default(false); - }); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('likes', function (Blueprint $table) { + $table->dropColumn(['status_profile_id', 'is_comment']); + $table->boolean('flagged')->default(false); + }); + } } diff --git a/database/migrations/2020_12_27_040951_add_skip_optimize_to_media_table.php b/database/migrations/2020_12_27_040951_add_skip_optimize_to_media_table.php index 7bc56a920..ef8e53107 100644 --- a/database/migrations/2020_12_27_040951_add_skip_optimize_to_media_table.php +++ b/database/migrations/2020_12_27_040951_add_skip_optimize_to_media_table.php @@ -6,28 +6,28 @@ use Illuminate\Support\Facades\Schema; class AddSkipOptimizeToMediaTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::table('media', function (Blueprint $table) { - $table->boolean('skip_optimize')->nullable()->index(); - $table->timestamp('replicated_at')->nullable(); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('media', function (Blueprint $table) { + $table->boolean('skip_optimize')->nullable()->index(); + $table->timestamp('replicated_at')->nullable(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('media', function (Blueprint $table) { - $table->dropColumn(['skip_optimize','replicated_at']); - }); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('media', function (Blueprint $table) { + $table->dropColumn(['skip_optimize', 'replicated_at']); + }); + } } diff --git a/database/migrations/2021_01_14_034521_add_cache_locks_table.php b/database/migrations/2021_01_14_034521_add_cache_locks_table.php index 07889b490..700b60c4a 100644 --- a/database/migrations/2021_01_14_034521_add_cache_locks_table.php +++ b/database/migrations/2021_01_14_034521_add_cache_locks_table.php @@ -1,7 +1,6 @@ string('cdn_url')->unique()->index()->nullable()->after('remote_url'); - $table->unsignedInteger('size')->nullable()->after('cdn_url'); - $table->boolean('is_remote')->nullable()->index()->after('cdn_url'); - $table->dropColumn('thumb_path'); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('avatars', function (Blueprint $table) { + $table->string('cdn_url')->unique()->index()->nullable()->after('remote_url'); + $table->unsignedInteger('size')->nullable()->after('cdn_url'); + $table->boolean('is_remote')->nullable()->index()->after('cdn_url'); + $table->dropColumn('thumb_path'); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('avatars', function (Blueprint $table) { - $table->dropColumn(['cdn_url','size','is_remote']); - $table->string('thumb_path')->nullable(); - }); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('avatars', function (Blueprint $table) { + $table->dropColumn(['cdn_url', 'size', 'is_remote']); + $table->string('thumb_path')->nullable(); + }); + } } diff --git a/database/migrations/2021_04_28_060450_create_config_caches_table.php b/database/migrations/2021_04_28_060450_create_config_caches_table.php index aab7ab782..dd8b84709 100644 --- a/database/migrations/2021_04_28_060450_create_config_caches_table.php +++ b/database/migrations/2021_04_28_060450_create_config_caches_table.php @@ -6,29 +6,29 @@ use Illuminate\Support\Facades\Schema; class CreateConfigCachesTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('config_cache', function (Blueprint $table) { - $table->id(); - $table->string('k')->unique()->index(); - $table->text('v')->nullable(); - $table->json('metadata')->nullable(); - $table->timestamps(); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('config_cache', function (Blueprint $table) { + $table->id(); + $table->string('k')->unique()->index(); + $table->text('v')->nullable(); + $table->json('metadata')->nullable(); + $table->timestamps(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('config_cache'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('config_cache'); + } } diff --git a/database/migrations/2021_07_23_062326_add_compose_settings_to_user_settings_table.php b/database/migrations/2021_07_23_062326_add_compose_settings_to_user_settings_table.php index 9cbb317c5..53d1c7c9d 100644 --- a/database/migrations/2021_07_23_062326_add_compose_settings_to_user_settings_table.php +++ b/database/migrations/2021_07_23_062326_add_compose_settings_to_user_settings_table.php @@ -18,10 +18,10 @@ class AddComposeSettingsToUserSettingsTable extends Migration }); Schema::table('media', function (Blueprint $table) { - $table->text('caption')->change(); - $table->index('profile_id'); - $table->index('mime'); - $table->index('license'); + $table->text('caption')->change(); + $table->index('profile_id'); + $table->index('mime'); + $table->index('license'); }); } @@ -42,7 +42,9 @@ class AddComposeSettingsToUserSettingsTable extends Migration $table->string('caption')->change(); $indexes = Schema::getIndexes('media'); - $indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray(); + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); if (in_array('media_profile_id_index', $indexesFound)) { $table->dropIndex('media_profile_id_index'); } diff --git a/database/migrations/2021_07_29_014835_create_polls_table.php b/database/migrations/2021_07_29_014835_create_polls_table.php index 0ae7a58ad..39f0a0414 100644 --- a/database/migrations/2021_07_29_014835_create_polls_table.php +++ b/database/migrations/2021_07_29_014835_create_polls_table.php @@ -6,37 +6,37 @@ use Illuminate\Support\Facades\Schema; class CreatePollsTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('polls', function (Blueprint $table) { - $table->bigInteger('id')->unsigned()->primary(); - $table->bigInteger('story_id')->unsigned()->nullable()->index(); - $table->bigInteger('status_id')->unsigned()->nullable()->index(); - $table->bigInteger('group_id')->unsigned()->nullable()->index(); - $table->bigInteger('profile_id')->unsigned()->index(); - $table->json('poll_options')->nullable(); - $table->json('cached_tallies')->nullable(); - $table->boolean('multiple')->default(false); - $table->boolean('hide_totals')->default(false); - $table->unsignedInteger('votes_count')->default(0); - $table->timestamp('last_fetched_at')->nullable(); - $table->timestamp('expires_at')->nullable(); - $table->timestamps(); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('polls', function (Blueprint $table) { + $table->bigInteger('id')->unsigned()->primary(); + $table->bigInteger('story_id')->unsigned()->nullable()->index(); + $table->bigInteger('status_id')->unsigned()->nullable()->index(); + $table->bigInteger('group_id')->unsigned()->nullable()->index(); + $table->bigInteger('profile_id')->unsigned()->index(); + $table->json('poll_options')->nullable(); + $table->json('cached_tallies')->nullable(); + $table->boolean('multiple')->default(false); + $table->boolean('hide_totals')->default(false); + $table->unsignedInteger('votes_count')->default(0); + $table->timestamp('last_fetched_at')->nullable(); + $table->timestamp('expires_at')->nullable(); + $table->timestamps(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('polls'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('polls'); + } } diff --git a/database/migrations/2021_08_04_095143_create_group_members_table.php b/database/migrations/2021_08_04_095143_create_group_members_table.php index 33df26229..19290b400 100644 --- a/database/migrations/2021_08_04_095143_create_group_members_table.php +++ b/database/migrations/2021_08_04_095143_create_group_members_table.php @@ -6,35 +6,35 @@ use Illuminate\Support\Facades\Schema; class CreateGroupMembersTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('group_members', function (Blueprint $table) { - $table->id(); - $table->bigInteger('group_id')->unsigned()->index(); - $table->bigInteger('profile_id')->unsigned()->index(); - $table->string('role')->default('member')->index(); - $table->boolean('local_group')->default(false)->index(); - $table->boolean('local_profile')->default(false)->index(); - $table->boolean('join_request')->default(false)->index(); - $table->timestamp('approved_at')->nullable(); - $table->timestamp('rejected_at')->nullable(); - $table->unique(['group_id', 'profile_id']); - $table->timestamps(); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('group_members', function (Blueprint $table) { + $table->id(); + $table->bigInteger('group_id')->unsigned()->index(); + $table->bigInteger('profile_id')->unsigned()->index(); + $table->string('role')->default('member')->index(); + $table->boolean('local_group')->default(false)->index(); + $table->boolean('local_profile')->default(false)->index(); + $table->boolean('join_request')->default(false)->index(); + $table->timestamp('approved_at')->nullable(); + $table->timestamp('rejected_at')->nullable(); + $table->unique(['group_id', 'profile_id']); + $table->timestamps(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('group_members'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('group_members'); + } } diff --git a/database/migrations/2021_08_04_095238_create_group_posts_table.php b/database/migrations/2021_08_04_095238_create_group_posts_table.php index a5e637d8e..de2b3be68 100644 --- a/database/migrations/2021_08_04_095238_create_group_posts_table.php +++ b/database/migrations/2021_08_04_095238_create_group_posts_table.php @@ -6,37 +6,37 @@ use Illuminate\Support\Facades\Schema; class CreateGroupPostsTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('group_posts', function (Blueprint $table) { - $table->bigInteger('id')->unsigned()->primary(); - $table->bigInteger('group_id')->unsigned()->index(); - $table->bigInteger('profile_id')->unsigned()->nullable()->index(); - $table->string('type')->nullable()->index(); - $table->bigInteger('status_id')->unsigned()->unique(); - $table->string('remote_url')->unique()->nullable()->index(); - $table->bigInteger('reply_child_id')->unsigned()->nullable(); - $table->bigInteger('in_reply_to_id')->unsigned()->nullable(); - $table->bigInteger('reblog_of_id')->unsigned()->nullable(); - $table->unsignedInteger('reply_count')->nullable(); - $table->string('status')->nullable()->index(); - $table->json('metadata')->nullable(); - $table->timestamps(); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('group_posts', function (Blueprint $table) { + $table->bigInteger('id')->unsigned()->primary(); + $table->bigInteger('group_id')->unsigned()->index(); + $table->bigInteger('profile_id')->unsigned()->nullable()->index(); + $table->string('type')->nullable()->index(); + $table->bigInteger('status_id')->unsigned()->unique(); + $table->string('remote_url')->unique()->nullable()->index(); + $table->bigInteger('reply_child_id')->unsigned()->nullable(); + $table->bigInteger('in_reply_to_id')->unsigned()->nullable(); + $table->bigInteger('reblog_of_id')->unsigned()->nullable(); + $table->unsignedInteger('reply_count')->nullable(); + $table->string('status')->nullable()->index(); + $table->json('metadata')->nullable(); + $table->timestamps(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('group_posts'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('group_posts'); + } } diff --git a/database/migrations/2021_08_04_100435_create_group_roles_table.php b/database/migrations/2021_08_04_100435_create_group_roles_table.php index c2b0d0ff4..ae6ba68b0 100644 --- a/database/migrations/2021_08_04_100435_create_group_roles_table.php +++ b/database/migrations/2021_08_04_100435_create_group_roles_table.php @@ -6,31 +6,31 @@ use Illuminate\Support\Facades\Schema; class CreateGroupRolesTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('group_roles', function (Blueprint $table) { - $table->id(); - $table->bigInteger('group_id')->unsigned()->index(); - $table->string('name'); - $table->string('slug')->nullable(); - $table->text('abilities')->nullable(); - $table->unique(['group_id', 'slug']); - $table->timestamps(); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('group_roles', function (Blueprint $table) { + $table->id(); + $table->bigInteger('group_id')->unsigned()->index(); + $table->string('name'); + $table->string('slug')->nullable(); + $table->text('abilities')->nullable(); + $table->unique(['group_id', 'slug']); + $table->timestamps(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('group_roles'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('group_roles'); + } } diff --git a/database/migrations/2021_08_16_072457_create_group_invitations_table.php b/database/migrations/2021_08_16_072457_create_group_invitations_table.php index aa13db23a..99b1f8da8 100644 --- a/database/migrations/2021_08_16_072457_create_group_invitations_table.php +++ b/database/migrations/2021_08_16_072457_create_group_invitations_table.php @@ -6,33 +6,33 @@ use Illuminate\Support\Facades\Schema; class CreateGroupInvitationsTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('group_invitations', function (Blueprint $table) { - $table->bigIncrements('id'); - $table->bigInteger('group_id')->unsigned()->index(); - $table->bigInteger('from_profile_id')->unsigned()->index(); - $table->bigInteger('to_profile_id')->unsigned()->index(); - $table->string('role')->nullable(); - $table->boolean('to_local')->default(true)->index(); - $table->boolean('from_local')->default(true)->index(); - $table->unique(['group_id', 'to_profile_id']); - $table->timestamps(); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('group_invitations', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->bigInteger('group_id')->unsigned()->index(); + $table->bigInteger('from_profile_id')->unsigned()->index(); + $table->bigInteger('to_profile_id')->unsigned()->index(); + $table->string('role')->nullable(); + $table->boolean('to_local')->default(true)->index(); + $table->boolean('from_local')->default(true)->index(); + $table->unique(['group_id', 'to_profile_id']); + $table->timestamps(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('group_invitations'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('group_invitations'); + } } diff --git a/database/migrations/2021_08_16_100034_create_group_interactions_table.php b/database/migrations/2021_08_16_100034_create_group_interactions_table.php index adc32d1d1..8b86682ec 100644 --- a/database/migrations/2021_08_16_100034_create_group_interactions_table.php +++ b/database/migrations/2021_08_16_100034_create_group_interactions_table.php @@ -6,32 +6,32 @@ use Illuminate\Support\Facades\Schema; class CreateGroupInteractionsTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('group_interactions', function (Blueprint $table) { - $table->bigIncrements('id'); - $table->bigInteger('group_id')->unsigned()->index(); - $table->bigInteger('profile_id')->unsigned()->index(); - $table->string('type')->nullable()->index(); - $table->string('item_type')->nullable()->index(); - $table->string('item_id')->nullable()->index(); - $table->json('metadata')->nullable(); - $table->timestamps(); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('group_interactions', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->bigInteger('group_id')->unsigned()->index(); + $table->bigInteger('profile_id')->unsigned()->index(); + $table->string('type')->nullable()->index(); + $table->string('item_type')->nullable()->index(); + $table->string('item_id')->nullable()->index(); + $table->json('metadata')->nullable(); + $table->timestamps(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('group_interactions'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('group_interactions'); + } } diff --git a/database/migrations/2021_08_17_073839_create_group_reports_table.php b/database/migrations/2021_08_17_073839_create_group_reports_table.php index 93ed00d63..830b2caf0 100644 --- a/database/migrations/2021_08_17_073839_create_group_reports_table.php +++ b/database/migrations/2021_08_17_073839_create_group_reports_table.php @@ -16,13 +16,13 @@ class CreateGroupReportsTable extends Migration Schema::create('group_reports', function (Blueprint $table) { $table->id(); $table->bigInteger('group_id')->unsigned()->index(); - $table->bigInteger('profile_id')->unsigned()->index(); - $table->string('type')->nullable()->index(); - $table->string('item_type')->nullable()->index(); - $table->string('item_id')->nullable()->index(); - $table->json('metadata')->nullable(); - $table->boolean('open')->default(true)->index(); - $table->unique(['group_id', 'profile_id', 'item_type', 'item_id']); + $table->bigInteger('profile_id')->unsigned()->index(); + $table->string('type')->nullable()->index(); + $table->string('item_type')->nullable()->index(); + $table->string('item_id')->nullable()->index(); + $table->json('metadata')->nullable(); + $table->boolean('open')->default(true)->index(); + $table->unique(['group_id', 'profile_id', 'item_type', 'item_id']); $table->timestamps(); }); } diff --git a/database/migrations/2021_08_23_062246_update_stories_table_fix_expires_at_column.php b/database/migrations/2021_08_23_062246_update_stories_table_fix_expires_at_column.php index 26af256a7..710ef39d8 100644 --- a/database/migrations/2021_08_23_062246_update_stories_table_fix_expires_at_column.php +++ b/database/migrations/2021_08_23_062246_update_stories_table_fix_expires_at_column.php @@ -6,47 +6,51 @@ use Illuminate\Support\Facades\Schema; class UpdateStoriesTableFixExpiresAtColumn extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::table('stories', function (Blueprint $table) { + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('stories', function (Blueprint $table) { $indexes = Schema::getIndexes('stories'); - $indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray(); + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); if (in_array('stories_expires_at_index', $indexesFound)) { $table->dropIndex('stories_expires_at_index'); } - $table->timestamp('expires_at')->default(null)->index()->nullable()->change(); - $table->boolean('can_reply')->default(true); - $table->boolean('can_react')->default(true); - $table->string('object_id')->nullable()->unique(); - $table->string('object_uri')->nullable()->unique(); - $table->string('bearcap_token')->nullable(); - }); - } + $table->timestamp('expires_at')->default(null)->index()->nullable()->change(); + $table->boolean('can_reply')->default(true); + $table->boolean('can_react')->default(true); + $table->string('object_id')->nullable()->unique(); + $table->string('object_uri')->nullable()->unique(); + $table->string('bearcap_token')->nullable(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('stories', function (Blueprint $table) { - $indexes = Schema::getIndexes('stories'); - $indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray(); + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('stories', function (Blueprint $table) { + $indexes = Schema::getIndexes('stories'); + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); if (in_array('stories_expires_at_index', $indexesFound)) { $table->dropIndex('stories_expires_at_index'); } - $table->timestamp('expires_at')->default(null)->index()->nullable()->change(); - $table->dropColumn('can_reply'); - $table->dropColumn('can_react'); - $table->dropColumn('object_id'); - $table->dropColumn('object_uri'); - $table->dropColumn('bearcap_token'); - }); - } + $table->timestamp('expires_at')->default(null)->index()->nullable()->change(); + $table->dropColumn('can_reply'); + $table->dropColumn('can_react'); + $table->dropColumn('object_id'); + $table->dropColumn('object_uri'); + $table->dropColumn('bearcap_token'); + }); + } } diff --git a/database/migrations/2021_08_30_050137_add_software_column_to_instances_table.php b/database/migrations/2021_08_30_050137_add_software_column_to_instances_table.php index 80e499604..dd1d45fb4 100644 --- a/database/migrations/2021_08_30_050137_add_software_column_to_instances_table.php +++ b/database/migrations/2021_08_30_050137_add_software_column_to_instances_table.php @@ -1,46 +1,46 @@ string('software')->nullable()->index(); - $table->unsignedInteger('user_count')->nullable(); - $table->unsignedInteger('status_count')->nullable(); - $table->timestamp('last_crawled_at')->nullable(); - }); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('instances', function (Blueprint $table) { + $table->string('software')->nullable()->index(); + $table->unsignedInteger('user_count')->nullable(); + $table->unsignedInteger('status_count')->nullable(); + $table->timestamp('last_crawled_at')->nullable(); + }); - $this->runPostMigration(); - } + $this->runPostMigration(); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('instances', function (Blueprint $table) { - $table->dropColumn('software'); - $table->dropColumn('user_count'); - $table->dropColumn('status_count'); - $table->dropColumn('last_crawled_at'); - }); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('instances', function (Blueprint $table) { + $table->dropColumn('software'); + $table->dropColumn('user_count'); + $table->dropColumn('status_count'); + $table->dropColumn('last_crawled_at'); + }); + } - protected function runPostMigration() - { - InstanceCrawlPipeline::dispatch(); - } + protected function runPostMigration() + { + InstanceCrawlPipeline::dispatch(); + } } diff --git a/database/migrations/2021_09_26_112423_create_group_blocks_table.php b/database/migrations/2021_09_26_112423_create_group_blocks_table.php index 320fcf985..515ef9700 100644 --- a/database/migrations/2021_09_26_112423_create_group_blocks_table.php +++ b/database/migrations/2021_09_26_112423_create_group_blocks_table.php @@ -16,14 +16,14 @@ class CreateGroupBlocksTable extends Migration Schema::create('group_blocks', function (Blueprint $table) { $table->bigIncrements('id'); $table->bigInteger('group_id')->unsigned()->index(); - $table->bigInteger('admin_id')->unsigned()->nullable(); - $table->bigInteger('profile_id')->nullable()->unsigned()->index(); - $table->bigInteger('instance_id')->nullable()->unsigned()->index(); - $table->string('name')->nullable()->index(); - $table->string('reason')->nullable(); - $table->boolean('is_user')->index(); - $table->boolean('moderated')->default(false)->index(); - $table->unique(['group_id', 'profile_id', 'instance_id']); + $table->bigInteger('admin_id')->unsigned()->nullable(); + $table->bigInteger('profile_id')->nullable()->unsigned()->index(); + $table->bigInteger('instance_id')->nullable()->unsigned()->index(); + $table->string('name')->nullable()->index(); + $table->string('reason')->nullable(); + $table->boolean('is_user')->index(); + $table->boolean('moderated')->default(false)->index(); + $table->unique(['group_id', 'profile_id', 'instance_id']); $table->timestamps(); }); } diff --git a/database/migrations/2021_09_29_023230_create_group_limits_table.php b/database/migrations/2021_09_29_023230_create_group_limits_table.php index 67ca7bec8..adb8616f1 100644 --- a/database/migrations/2021_09_29_023230_create_group_limits_table.php +++ b/database/migrations/2021_09_29_023230_create_group_limits_table.php @@ -16,10 +16,10 @@ class CreateGroupLimitsTable extends Migration Schema::create('group_limits', function (Blueprint $table) { $table->id(); $table->bigInteger('group_id')->unsigned()->index(); - $table->bigInteger('profile_id')->unsigned()->index(); - $table->json('limits')->nullable(); - $table->json('metadata')->nullable(); - $table->unique(['group_id', 'profile_id']); + $table->bigInteger('profile_id')->unsigned()->index(); + $table->json('limits')->nullable(); + $table->json('metadata')->nullable(); + $table->unique(['group_id', 'profile_id']); $table->timestamps(); }); } diff --git a/database/migrations/2021_10_13_002041_create_group_events_table.php b/database/migrations/2021_10_13_002041_create_group_events_table.php index 166c35cf0..00174fbc8 100644 --- a/database/migrations/2021_10_13_002041_create_group_events_table.php +++ b/database/migrations/2021_10_13_002041_create_group_events_table.php @@ -6,39 +6,39 @@ use Illuminate\Support\Facades\Schema; class CreateGroupEventsTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('group_events', function (Blueprint $table) { - $table->bigIncrements('id'); - $table->bigInteger('group_id')->unsigned()->nullable()->index(); - $table->bigInteger('profile_id')->unsigned()->nullable()->index(); - $table->string('name')->nullable(); - $table->string('type')->index(); - $table->json('tags')->nullable(); - $table->json('location')->nullable(); - $table->text('description')->nullable(); - $table->json('metadata')->nullable(); - $table->boolean('open')->default(false)->index(); - $table->boolean('comments_open')->default(false); - $table->boolean('show_guest_list')->default(false); - $table->timestamp('start_at')->nullable(); - $table->timestamp('end_at')->nullable(); - $table->timestamps(); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('group_events', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->bigInteger('group_id')->unsigned()->nullable()->index(); + $table->bigInteger('profile_id')->unsigned()->nullable()->index(); + $table->string('name')->nullable(); + $table->string('type')->index(); + $table->json('tags')->nullable(); + $table->json('location')->nullable(); + $table->text('description')->nullable(); + $table->json('metadata')->nullable(); + $table->boolean('open')->default(false)->index(); + $table->boolean('comments_open')->default(false); + $table->boolean('show_guest_list')->default(false); + $table->timestamp('start_at')->nullable(); + $table->timestamp('end_at')->nullable(); + $table->timestamps(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('group_events'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('group_events'); + } } diff --git a/database/migrations/2021_11_06_100552_add_more_settings_to_user_settings_table.php b/database/migrations/2021_11_06_100552_add_more_settings_to_user_settings_table.php index 00af978f2..5788ce2ff 100644 --- a/database/migrations/2021_11_06_100552_add_more_settings_to_user_settings_table.php +++ b/database/migrations/2021_11_06_100552_add_more_settings_to_user_settings_table.php @@ -6,27 +6,27 @@ use Illuminate\Support\Facades\Schema; class AddMoreSettingsToUserSettingsTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::table('user_settings', function (Blueprint $table) { - $table->json('other')->nullable(); - }); - } + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('user_settings', function (Blueprint $table) { + $table->json('other')->nullable(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('user_settings', function (Blueprint $table) { - $table->dropColumn('other'); - }); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('user_settings', function (Blueprint $table) { + $table->dropColumn('other'); + }); + } } diff --git a/database/migrations/2021_11_09_105629_add_action_to_account_interstitials_table.php b/database/migrations/2021_11_09_105629_add_action_to_account_interstitials_table.php index e08738522..2e314ac79 100644 --- a/database/migrations/2021_11_09_105629_add_action_to_account_interstitials_table.php +++ b/database/migrations/2021_11_09_105629_add_action_to_account_interstitials_table.php @@ -14,7 +14,7 @@ class AddActionToAccountInterstitialsTable extends Migration public function up() { Schema::table('account_interstitials', function (Blueprint $table) { - $table->tinyInteger('severity_index')->unsigned()->nullable()->index(); + $table->tinyInteger('severity_index')->unsigned()->nullable()->index(); $table->boolean('is_spam')->nullable()->index()->after('item_type'); $table->boolean('in_violation')->nullable()->index()->after('is_spam'); $table->unsignedInteger('violation_id')->nullable()->index()->after('in_violation'); diff --git a/database/migrations/2022_01_19_025041_create_custom_emoji_table.php b/database/migrations/2022_01_19_025041_create_custom_emoji_table.php index 40ff9b3e9..1e22ee3c9 100644 --- a/database/migrations/2022_01_19_025041_create_custom_emoji_table.php +++ b/database/migrations/2022_01_19_025041_create_custom_emoji_table.php @@ -6,42 +6,42 @@ use Illuminate\Support\Facades\Schema; class CreateCustomEmojiTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('custom_emoji', function (Blueprint $table) { - $table->id(); - $table->string('shortcode')->index(); - $table->string('media_path')->nullable(); - $table->string('domain')->nullable()->index(); - $table->boolean('disabled')->default(false)->index(); - $table->string('uri')->nullable(); - $table->string('image_remote_url')->nullable(); - $table->unsignedInteger('category_id')->nullable(); - $table->unique(['shortcode', 'domain']); - $table->timestamps(); - }); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('custom_emoji', function (Blueprint $table) { + $table->id(); + $table->string('shortcode')->index(); + $table->string('media_path')->nullable(); + $table->string('domain')->nullable()->index(); + $table->boolean('disabled')->default(false)->index(); + $table->string('uri')->nullable(); + $table->string('image_remote_url')->nullable(); + $table->unsignedInteger('category_id')->nullable(); + $table->unique(['shortcode', 'domain']); + $table->timestamps(); + }); - Schema::create('custom_emoji_categories', function (Blueprint $table) { - $table->id(); - $table->string('name')->unique()->index(); - $table->boolean('disabled')->default(false)->index(); - $table->timestamps(); - }); - } + Schema::create('custom_emoji_categories', function (Blueprint $table) { + $table->id(); + $table->string('name')->unique()->index(); + $table->boolean('disabled')->default(false)->index(); + $table->timestamps(); + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('custom_emoji'); - Schema::dropIfExists('custom_emoji_categories'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('custom_emoji'); + Schema::dropIfExists('custom_emoji_categories'); + } } diff --git a/database/migrations/2022_02_13_091135_add_missing_reblog_of_id_types_to_statuses_table.php b/database/migrations/2022_02_13_091135_add_missing_reblog_of_id_types_to_statuses_table.php index 39b6bc64c..b2c9f9d18 100644 --- a/database/migrations/2022_02_13_091135_add_missing_reblog_of_id_types_to_statuses_table.php +++ b/database/migrations/2022_02_13_091135_add_missing_reblog_of_id_types_to_statuses_table.php @@ -1,9 +1,7 @@ whereNull('type') - ->update([ - 'type' => 'share' - ]); + ->whereNull('type') + ->update([ + 'type' => 'share', + ]); } /** @@ -26,7 +24,5 @@ class AddMissingReblogOfIdTypesToStatusesTable extends Migration * * @return void */ - public function down() - { - } + public function down() {} } diff --git a/database/migrations/2022_03_09_042023_add_ldap_columns_to_users_table.php b/database/migrations/2022_03_09_042023_add_ldap_columns_to_users_table.php index 58bc88809..8402f2f8a 100644 --- a/database/migrations/2022_03_09_042023_add_ldap_columns_to_users_table.php +++ b/database/migrations/2022_03_09_042023_add_ldap_columns_to_users_table.php @@ -1,8 +1,8 @@ bigIncrements('id'); @@ -34,21 +33,21 @@ class CreateConversationsTable extends Migration sleep(10); - if(DirectMessage::count()) { + if (DirectMessage::count()) { - foreach(DirectMessage::lazy() as $msg) { - Conversation::updateOrInsert([ - 'to_id' => $msg->to_id, - 'from_id' => $msg->from_id, - ], - [ - 'dm_id' => $msg->id, - 'status_id' => $msg->status_id, - 'type' => $msg->type, - 'created_at' => $msg->created_at, - 'updated_at' => $msg->updated_at - ]); - } + foreach (DirectMessage::lazy() as $msg) { + Conversation::updateOrInsert([ + 'to_id' => $msg->to_id, + 'from_id' => $msg->from_id, + ], + [ + 'dm_id' => $msg->id, + 'status_id' => $msg->status_id, + 'type' => $msg->type, + 'created_at' => $msg->created_at, + 'updated_at' => $msg->updated_at, + ]); + } } } diff --git a/database/migrations/2022_09_01_000000_fix_webfinger_profile_duplicate_accounts.php b/database/migrations/2022_09_01_000000_fix_webfinger_profile_duplicate_accounts.php index 3a10c9d5f..b76e34609 100644 --- a/database/migrations/2022_09_01_000000_fix_webfinger_profile_duplicate_accounts.php +++ b/database/migrations/2022_09_01_000000_fix_webfinger_profile_duplicate_accounts.php @@ -1,10 +1,8 @@ where('username', 'not like', '@%') - ->chunk(200, function($profiles) { - foreach($profiles as $profile) { + ->chunk(200, function ($profiles) { + foreach ($profiles as $profile) { $exists = Profile::whereUsername("@{$profile->username}@{$profile->domain}")->first(); - if($exists) { + if ($exists) { $exists->username = null; $exists->domain = null; $exists->webfinger = null; @@ -32,13 +30,13 @@ class FixWebfingerProfileDuplicateAccounts extends Migration DeleteRemoteProfilePipeline::dispatch($exists); $profile->username = "@{$profile->username}@{$profile->domain}"; - if(!$profile->webfinger) { + if (! $profile->webfinger) { $profile->webfinger = "@{$profile->username}@{$profile->domain}"; } $profile->save(); } else { $profile->username = "@{$profile->username}@{$profile->domain}"; - if(!$profile->webfinger) { + if (! $profile->webfinger) { $profile->webfinger = "@{$profile->username}@{$profile->domain}"; } $profile->save(); diff --git a/database/migrations/2022_09_01_043002_generate_missing_profile_webfinger.php b/database/migrations/2022_09_01_043002_generate_missing_profile_webfinger.php index 55a0f9002..97a6a5d8d 100644 --- a/database/migrations/2022_09_01_043002_generate_missing_profile_webfinger.php +++ b/database/migrations/2022_09_01_043002_generate_missing_profile_webfinger.php @@ -1,9 +1,7 @@ whereNull('webfinger') - ->chunk(200, function($profiles) { - foreach($profiles as $profile) { - if(substr($profile->username, 0, 1) === "@") { + ->chunk(200, function ($profiles) { + foreach ($profiles as $profile) { + if (substr($profile->username, 0, 1) === '@') { $profile->webfinger = $profile->username; $profile->save(); } diff --git a/database/migrations/2022_09_19_093029_fix_double_json_encoded_settings_in_usersettings_table.php b/database/migrations/2022_09_19_093029_fix_double_json_encoded_settings_in_usersettings_table.php index d2f43213f..939f59034 100644 --- a/database/migrations/2022_09_19_093029_fix_double_json_encoded_settings_in_usersettings_table.php +++ b/database/migrations/2022_09_19_093029_fix_double_json_encoded_settings_in_usersettings_table.php @@ -1,9 +1,7 @@ chunk(50, function($settings) { - foreach($settings as $userSetting) { - if(is_array($userSetting->compose_settings)) { - continue; + ->chunk(50, function ($settings) { + foreach ($settings as $userSetting) { + if (is_array($userSetting->compose_settings)) { + continue; + } + $userSetting->compose_settings = json_decode($userSetting->compose_settings); + $userSetting->save(); } - $userSetting->compose_settings = json_decode($userSetting->compose_settings); - $userSetting->save(); - } - }); + }); } /** @@ -31,8 +29,5 @@ class FixDoubleJsonEncodedSettingsInUsersettingsTable extends Migration * * @return void */ - public function down() - { - - } + public function down() {} } diff --git a/database/migrations/2022_10_07_055133_remove_old_compound_index_from_statuses_table.php b/database/migrations/2022_10_07_055133_remove_old_compound_index_from_statuses_table.php index e3f943dd8..accbdb3f6 100644 --- a/database/migrations/2022_10_07_055133_remove_old_compound_index_from_statuses_table.php +++ b/database/migrations/2022_10_07_055133_remove_old_compound_index_from_statuses_table.php @@ -15,7 +15,9 @@ class RemoveOldCompoundIndexFromStatusesTable extends Migration { Schema::table('statuses', function (Blueprint $table) { $indexes = Schema::getIndexes('statuses'); - $indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray(); + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); if (in_array('statuses_in_reply_to_id_reblog_of_id_index', $indexesFound)) { $table->dropIndex('statuses_in_reply_to_id_reblog_of_id_index'); } diff --git a/database/migrations/2022_10_09_043758_fix_cdn_url_in_avatars_table.php b/database/migrations/2022_10_09_043758_fix_cdn_url_in_avatars_table.php index 65b19496b..8e9ac9836 100644 --- a/database/migrations/2022_10_09_043758_fix_cdn_url_in_avatars_table.php +++ b/database/migrations/2022_10_09_043758_fix_cdn_url_in_avatars_table.php @@ -1,11 +1,9 @@ chunk(50, function($avatars) use($baseUrl) { - foreach($avatars as $avatar) { - if(substr($avatar->cdn_url, 0, 23) === '/storage/cache/avatars/') { - $avatar->cdn_url = $baseUrl . $avatar->cdn_url; - $avatar->save(); + ->chunk(50, function ($avatars) use ($baseUrl) { + foreach ($avatars as $avatar) { + if (substr($avatar->cdn_url, 0, 23) === '/storage/cache/avatars/') { + $avatar->cdn_url = $baseUrl.$avatar->cdn_url; + $avatar->save(); + } + Cache::forget('avatar:'.$avatar->profile_id); + AccountService::del($avatar->profile_id); } - Cache::forget('avatar:' . $avatar->profile_id); - AccountService::del($avatar->profile_id); - } - }); + }); } /** @@ -35,7 +33,5 @@ class FixCdnUrlInAvatarsTable extends Migration * * @return void */ - public function down() - { - } + public function down() {} } diff --git a/database/migrations/2022_11_30_123940_update_avatars_table_remove_cdn_url_unique_constraint.php b/database/migrations/2022_11_30_123940_update_avatars_table_remove_cdn_url_unique_constraint.php index a3767fec0..2403b872f 100644 --- a/database/migrations/2022_11_30_123940_update_avatars_table_remove_cdn_url_unique_constraint.php +++ b/database/migrations/2022_11_30_123940_update_avatars_table_remove_cdn_url_unique_constraint.php @@ -15,7 +15,9 @@ return new class extends Migration { Schema::table('avatars', function (Blueprint $table) { $indexes = Schema::getIndexes('avatars'); - $indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray(); + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); if (in_array('avatars_cdn_url_unique', $indexesFound)) { $table->dropUnique('avatars_cdn_url_unique'); } diff --git a/database/migrations/2022_12_18_133815_add_default_value_to_admin_invites_table.php b/database/migrations/2022_12_18_133815_add_default_value_to_admin_invites_table.php index d15191a68..d78d9637f 100644 --- a/database/migrations/2022_12_18_133815_add_default_value_to_admin_invites_table.php +++ b/database/migrations/2022_12_18_133815_add_default_value_to_admin_invites_table.php @@ -25,7 +25,6 @@ return new class extends Migration */ public function down() { - Schema::table('admin_invites', function (Blueprint $table) { - }); + Schema::table('admin_invites', function (Blueprint $table) {}); } }; diff --git a/database/migrations/2022_12_27_102053_update_hashtag_count.php b/database/migrations/2022_12_27_102053_update_hashtag_count.php index defcfa648..8d8fc1a86 100644 --- a/database/migrations/2022_12_27_102053_update_hashtag_count.php +++ b/database/migrations/2022_12_27_102053_update_hashtag_count.php @@ -1,10 +1,8 @@ chunkById(50, function($hashtags) { - foreach($hashtags as $hashtag) { + Hashtag::withoutEvents(function () { + Hashtag::whereNotNull('cached_count')->chunkById(50, function ($hashtags) { + foreach ($hashtags as $hashtag) { $count = DB::table('status_hashtags')->whereHashtagId($hashtag->id)->count(); $hashtag->cached_count = $count; $hashtag->can_trend = true; diff --git a/database/migrations/2022_12_31_034627_fix_account_status_deletes.php b/database/migrations/2022_12_31_034627_fix_account_status_deletes.php index e5aab2859..87218a8aa 100644 --- a/database/migrations/2022_12_31_034627_fix_account_status_deletes.php +++ b/database/migrations/2022_12_31_034627_fix_account_status_deletes.php @@ -1,10 +1,8 @@ get()->each(function($status) { StatusDelete::dispatch($status); }); + Status::doesntHave('profile')->get()->each(function ($status) { + StatusDelete::dispatch($status); + }); } /** diff --git a/database/migrations/2023_01_15_041933_add_missing_profile_id_to_users_table.php b/database/migrations/2023_01_15_041933_add_missing_profile_id_to_users_table.php index 9ea582e43..7919ed39c 100644 --- a/database/migrations/2023_01_15_041933_add_missing_profile_id_to_users_table.php +++ b/database/migrations/2023_01_15_041933_add_missing_profile_id_to_users_table.php @@ -1,10 +1,8 @@ chunk(20, function($users) { - foreach($users as $user) { - $profile = Profile::whereUsername($user->username)->first(); - if($profile) { - $user->profile_id = $profile->id; - $user->save(); + ->chunk(20, function ($users) { + foreach ($users as $user) { + $profile = Profile::whereUsername($user->username)->first(); + if ($profile) { + $user->profile_id = $profile->id; + $user->save(); + } } - } - }); + }); } /** @@ -32,8 +30,5 @@ return new class extends Migration * * @return void */ - public function down() - { - - } + public function down() {} }; diff --git a/database/migrations/2023_01_19_141156_fix_bookmark_visibility.php b/database/migrations/2023_01_19_141156_fix_bookmark_visibility.php index 50cb88090..2d6c656ec 100644 --- a/database/migrations/2023_01_19_141156_fix_bookmark_visibility.php +++ b/database/migrations/2023_01_19_141156_fix_bookmark_visibility.php @@ -1,11 +1,9 @@ status_id); - if(!$status) { + if (! $status) { $bookmark->delete(); + continue; } - if(!in_array($status->visibility, ['public', 'unlisted', 'private'])) { + if (! in_array($status->visibility, ['public', 'unlisted', 'private'])) { $bookmark->delete(); + continue; } - if(!in_array($status->visibility, ['public', 'unlisted'])) { - if($bookmark->profile_id == $status->profile_id) { + if (! in_array($status->visibility, ['public', 'unlisted'])) { + if ($bookmark->profile_id == $status->profile_id) { continue; } else { - if(!FollowerService::follows($bookmark->profile_id, $status->profile_id)) { + if (! FollowerService::follows($bookmark->profile_id, $status->profile_id)) { $bookmark->delete(); } } diff --git a/database/migrations/2023_01_21_124608_fix_duplicate_profiles.php b/database/migrations/2023_01_21_124608_fix_duplicate_profiles.php index 12c8b82e5..822640a14 100644 --- a/database/migrations/2023_01_21_124608_fix_duplicate_profiles.php +++ b/database/migrations/2023_01_21_124608_fix_duplicate_profiles.php @@ -1,8 +1,6 @@ url('test'); - if(!$startUrl) { + if (! $startUrl) { return; } $baseUrl = substr($startUrl, 0, -4); $baseUrlLen = strlen($baseUrl); - foreach(Media::whereNotNull('cdn_url')->lazyById(200, 'id') as $media) { - if($media->cdn_url == null) { + foreach (Media::whereNotNull('cdn_url')->lazyById(200, 'id') as $media) { + if ($media->cdn_url == null) { continue; } $cdnPath = substr($media->cdn_url, $baseUrlLen); - if(str_starts_with($cdnPath, '/')) { + if (str_starts_with($cdnPath, '/')) { continue; } - if(!str_starts_with($cdnPath, 'public/')) { + if (! str_starts_with($cdnPath, 'public/')) { continue; } - if($cdnPath != $media->media_path) { + if ($cdnPath != $media->media_path) { $media->media_path = $cdnPath; $media->saveQuietly(); - if($media->status_id) { + if ($media->status_id) { MediaService::del($media->status_id); StatusService::del($media->status_id); } } } - return; } /** diff --git a/database/migrations/2023_04_20_092740_fix_account_blocks.php b/database/migrations/2023_04_20_092740_fix_account_blocks.php index c80f86647..40c554f2a 100644 --- a/database/migrations/2023_04_20_092740_fix_account_blocks.php +++ b/database/migrations/2023_04_20_092740_fix_account_blocks.php @@ -1,17 +1,15 @@ whereFilterableType(\App\Profile::class) - ->chunk(10, function($filters) { - foreach($filters as $filter) { - $actor = Profile::whereNull('status')->find($filter->user_id); - if(!$actor) { - continue; - } - $target = Profile::whereNull('status')->find($filter->filterable_id); - if(!$target) { - continue; - } + ->whereFilterableType(Profile::class) + ->chunk(10, function ($filters) { + foreach ($filters as $filter) { + $actor = Profile::whereNull('status')->find($filter->user_id); + if (! $actor) { + continue; + } + $target = Profile::whereNull('status')->find($filter->filterable_id); + if (! $target) { + continue; + } - $followed = Follower::whereProfileId($target->id)->whereFollowingId($actor->id)->first(); - if($followed) { - $followed->delete(); - $target->following_count = Follower::whereProfileId($target->id)->count(); - $target->save(); - $actor->followers_count = Follower::whereFollowingId($actor->id)->count(); - $actor->save(); - FollowerService::remove($target->id, $actor->id); - AccountService::del($actor->id); - AccountService::del($target->id); - } + $followed = Follower::whereProfileId($target->id)->whereFollowingId($actor->id)->first(); + if ($followed) { + $followed->delete(); + $target->following_count = Follower::whereProfileId($target->id)->count(); + $target->save(); + $actor->followers_count = Follower::whereFollowingId($actor->id)->count(); + $actor->save(); + FollowerService::remove($target->id, $actor->id); + AccountService::del($actor->id); + AccountService::del($target->id); + } - $following = Follower::whereProfileId($actor->id)->whereFollowingId($target->id)->first(); - if($following) { - $following->delete(); - $actor->followers_count = Follower::whereFollowingId($target->id)->count(); - $actor->save(); - $target->following_count = Follower::whereProfileId($actor->id)->count(); - $target->save(); - FollowerService::remove($actor->id, $target->id); - AccountService::del($actor->id); - AccountService::del($target->id); - } + $following = Follower::whereProfileId($actor->id)->whereFollowingId($target->id)->first(); + if ($following) { + $following->delete(); + $actor->followers_count = Follower::whereFollowingId($target->id)->count(); + $actor->save(); + $target->following_count = Follower::whereProfileId($actor->id)->count(); + $target->save(); + FollowerService::remove($actor->id, $target->id); + AccountService::del($actor->id); + AccountService::del($target->id); + } - Notification::whereProfileId($actor->id) - ->whereActorId($target->id) - ->get() - ->map(function($n) use($actor) { - NotificationService::del($actor->id, $n['id']); - $n->forceDelete(); - }); + Notification::whereProfileId($actor->id) + ->whereActorId($target->id) + ->get() + ->map(function ($n) use ($actor) { + NotificationService::del($actor->id, $n['id']); + $n->forceDelete(); + }); - UserFilterService::block($actor->id, $target->id); - RelationshipService::refresh($actor->id, $target->id); - } - }); + UserFilterService::block($actor->id, $target->id); + RelationshipService::refresh($actor->id, $target->id); + } + }); } /** diff --git a/database/migrations/2023_05_03_023758_update_postgres_visibility_defaults_on_statuses_table.php b/database/migrations/2023_05_03_023758_update_postgres_visibility_defaults_on_statuses_table.php index b3753fd52..1727a4ac3 100644 --- a/database/migrations/2023_05_03_023758_update_postgres_visibility_defaults_on_statuses_table.php +++ b/database/migrations/2023_05_03_023758_update_postgres_visibility_defaults_on_statuses_table.php @@ -1,8 +1,6 @@ name)->orderBy('id')->get(); - if($dups->count() === 1) { - continue; - } + foreach (Hashtag::lazyById(50, 'id') as $tag) { + $dups = Hashtag::where('name', 'ilike', $tag->name)->orderBy('id')->get(); + if ($dups->count() === 1) { + continue; + } - $first = $dups->shift(); - $dups->each(function($dup) use($first) { - StatusHashtag::whereHashtagId($dup->id)->update(['hashtag_id' => $first->id]); - $dup->delete(); - }); + $first = $dups->shift(); + $dups->each(function ($dup) use ($first) { + StatusHashtag::whereHashtagId($dup->id)->update(['hashtag_id' => $first->id]); + $dup->delete(); + }); } Cache::clear(); diff --git a/database/migrations/2023_05_13_045228_remove_unused_columns_from_notifications_table.php b/database/migrations/2023_05_13_045228_remove_unused_columns_from_notifications_table.php index 1c450f920..710546776 100644 --- a/database/migrations/2023_05_13_045228_remove_unused_columns_from_notifications_table.php +++ b/database/migrations/2023_05_13_045228_remove_unused_columns_from_notifications_table.php @@ -12,20 +12,18 @@ return new class extends Migration public function up(): void { Schema::table('notifications', function (Blueprint $table) { - if(Schema::hasColumn('notifications', 'message')) { - $table->dropColumn('message'); - } + if (Schema::hasColumn('notifications', 'message')) { + $table->dropColumn('message'); + } - if(Schema::hasColumn('notifications', 'rendered')) { - $table->dropColumn('rendered'); - } + if (Schema::hasColumn('notifications', 'rendered')) { + $table->dropColumn('rendered'); + } }); } /** * Reverse the migrations. */ - public function down(): void - { - } + public function down(): void {} }; diff --git a/database/migrations/2023_05_13_123119_remove_status_entities_from_statuses_table.php b/database/migrations/2023_05_13_123119_remove_status_entities_from_statuses_table.php index 9a7fb4734..bdecae3d2 100644 --- a/database/migrations/2023_05_13_123119_remove_status_entities_from_statuses_table.php +++ b/database/migrations/2023_05_13_123119_remove_status_entities_from_statuses_table.php @@ -1,9 +1,7 @@ lazyById(200, 'id') as $status) { - if(!in_array($status->scope, ['public', 'unlisted', 'private'])) { - continue; - } - if(str_starts_with($status->entities, '{"urls')) { - $status->entities = null; - $status->save(); - } else { - continue; - } - } + foreach (Status::whereNotNull('entities')->lazyById(200, 'id') as $status) { + if (! in_array($status->scope, ['public', 'unlisted', 'private'])) { + continue; + } + if (str_starts_with($status->entities, '{"urls')) { + $status->entities = null; + $status->save(); + } else { + continue; + } + } } /** * Reverse the migrations. */ - public function down(): void - { - } + public function down(): void {} }; diff --git a/database/migrations/2023_11_13_062429_add_followers_count_index_to_profiles_table.php b/database/migrations/2023_11_13_062429_add_followers_count_index_to_profiles_table.php index bcc97577c..5f0c2b298 100644 --- a/database/migrations/2023_11_13_062429_add_followers_count_index_to_profiles_table.php +++ b/database/migrations/2023_11_13_062429_add_followers_count_index_to_profiles_table.php @@ -12,10 +12,10 @@ return new class extends Migration public function up(): void { Schema::table('profiles', function (Blueprint $table) { - $table->index('followers_count', 'profiles_followers_count_index'); - $table->index('following_count', 'profiles_following_count_index'); - $table->index('status_count', 'profiles_status_count_index'); - $table->index('is_private', 'profiles_is_private_index'); + $table->index('followers_count', 'profiles_followers_count_index'); + $table->index('following_count', 'profiles_following_count_index'); + $table->index('status_count', 'profiles_status_count_index'); + $table->index('is_private', 'profiles_is_private_index'); }); } diff --git a/database/migrations/2023_12_04_041631_create_push_subscriptions_table.php b/database/migrations/2023_12_04_041631_create_push_subscriptions_table.php index 550a98f6a..5f566e524 100644 --- a/database/migrations/2023_12_04_041631_create_push_subscriptions_table.php +++ b/database/migrations/2023_12_04_041631_create_push_subscriptions_table.php @@ -1,8 +1,8 @@ whereNotNull('url')->whereNull('object_url')->lazyById(50, 'id') as $status) { + foreach (Status::whereScope('direct')->whereNotNull('url')->whereNull('object_url')->lazyById(50, 'id') as $status) { try { $status->object_url = $status->url; $status->uri = $status->url; $status->save(); - } catch (Exception | UniqueConstraintViolationException $e) { + } catch (Exception|UniqueConstraintViolationException $e) { continue; } } @@ -27,7 +25,5 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down(): void - { - } + public function down(): void {} }; diff --git a/database/migrations/2023_12_21_103223_purge_deleted_status_hashtags.php b/database/migrations/2023_12_21_103223_purge_deleted_status_hashtags.php index bf2acc34e..6b112c394 100644 --- a/database/migrations/2023_12_21_103223_purge_deleted_status_hashtags.php +++ b/database/migrations/2023_12_21_103223_purge_deleted_status_hashtags.php @@ -1,9 +1,7 @@ map(function($i) { return $i['name']; })->toArray(); + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); if (in_array('user_roles_profile_id_unique', $indexesFound)) { $table->dropUnique('user_roles_profile_id_unique'); } @@ -43,7 +45,9 @@ return new class extends Migration Schema::table('user_roles', function (Blueprint $table) { $indexes = Schema::getIndexes('user_roles'); - $indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray(); + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); if (in_array('user_roles_profile_id_unique', $indexesFound)) { $table->dropUnique('user_roles_profile_id_unique'); } diff --git a/database/migrations/2024_02_24_093824_add_has_responded_to_curated_registers_table.php b/database/migrations/2024_02_24_093824_add_has_responded_to_curated_registers_table.php index 9453a73d7..e43e8474c 100644 --- a/database/migrations/2024_02_24_093824_add_has_responded_to_curated_registers_table.php +++ b/database/migrations/2024_02_24_093824_add_has_responded_to_curated_registers_table.php @@ -1,10 +1,10 @@ boolean('user_has_responded')->default(false)->index()->after('is_awaiting_more_info'); }); - CuratedRegisterActivity::whereFromUser(true)->get()->each(function($cra) { + CuratedRegisterActivity::whereFromUser(true)->get()->each(function ($cra) { $cr = CuratedRegister::find($cra->register_id); $cr->user_has_responded = true; $cr->save(); diff --git a/database/migrations/2024_03_08_123356_add_shared_inboxes_to_instances_table.php b/database/migrations/2024_03_08_123356_add_shared_inboxes_to_instances_table.php index ff7eebc69..28f75d769 100644 --- a/database/migrations/2024_03_08_123356_add_shared_inboxes_to_instances_table.php +++ b/database/migrations/2024_03_08_123356_add_shared_inboxes_to_instances_table.php @@ -1,10 +1,8 @@ domain)->whereNotNull('sharedInbox')->first(); - if($si && $si->sharedInbox) { + if ($si && $si->sharedInbox) { $instance->shared_inbox = $si->sharedInbox; $instance->save(); } @@ -25,8 +23,5 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down(): void - { - - } + public function down(): void {} }; diff --git a/database/migrations/2024_05_31_090555_update_instances_table_add_index_to_nodeinfo_last_fetched_at.php b/database/migrations/2024_05_31_090555_update_instances_table_add_index_to_nodeinfo_last_fetched_at.php index a5eb3b921..2f007391e 100644 --- a/database/migrations/2024_05_31_090555_update_instances_table_add_index_to_nodeinfo_last_fetched_at.php +++ b/database/migrations/2024_05_31_090555_update_instances_table_add_index_to_nodeinfo_last_fetched_at.php @@ -13,8 +13,10 @@ return new class extends Migration { Schema::table('instances', function (Blueprint $table) { $indexes = Schema::getIndexes('instances'); - $indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray(); - if (!in_array('instances_nodeinfo_last_fetched_index', $indexesFound)) { + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); + if (! in_array('instances_nodeinfo_last_fetched_index', $indexesFound)) { $table->index('nodeinfo_last_fetched'); } }); @@ -27,7 +29,9 @@ return new class extends Migration { Schema::table('instances', function (Blueprint $table) { $indexes = Schema::getIndexes('instances'); - $indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray(); + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); if (in_array('instances_nodeinfo_last_fetched_index', $indexesFound)) { $table->dropIndex('instances_nodeinfo_last_fetched_index'); } diff --git a/database/migrations/2024_06_03_232204_add_url_index_to_statuses_table.php b/database/migrations/2024_06_03_232204_add_url_index_to_statuses_table.php index 98ce0d5e9..174b5f769 100644 --- a/database/migrations/2024_06_03_232204_add_url_index_to_statuses_table.php +++ b/database/migrations/2024_06_03_232204_add_url_index_to_statuses_table.php @@ -13,8 +13,10 @@ return new class extends Migration { Schema::table('statuses', function (Blueprint $table) { $indexes = Schema::getIndexes('statuses'); - $indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray(); - if (!in_array('statuses_url_index', $indexesFound)) { + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); + if (! in_array('statuses_url_index', $indexesFound)) { $table->index('url'); } }); @@ -27,7 +29,9 @@ return new class extends Migration { Schema::table('statuses', function (Blueprint $table) { $indexes = Schema::getIndexes('statuses'); - $indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray(); + $indexesFound = collect($indexes)->map(function ($i) { + return $i['name']; + })->toArray(); if (in_array('statuses_url_index', $indexesFound)) { $table->dropIndex('statuses_url_index'); } diff --git a/database/migrations/2024_06_19_084835_add_total_local_posts_to_config_cache.php b/database/migrations/2024_06_19_084835_add_total_local_posts_to_config_cache.php index 35f00f60a..efff16817 100644 --- a/database/migrations/2024_06_19_084835_add_total_local_posts_to_config_cache.php +++ b/database/migrations/2024_06_19_084835_add_total_local_posts_to_config_cache.php @@ -1,12 +1,10 @@ whereNull(['url', 'deleted_at'])->count(); $res = [ - 'count' => $count + 'count' => $count, ]; - Storage::put('total_local_posts.json', json_encode($res, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT)); + Storage::put('total_local_posts.json', json_encode($res, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)); ConfigCacheService::put('instance.stats.total_local_posts', $res['count']); Cache::forget('api:nodeinfo'); } diff --git a/database/migrations/2024_10_15_044935_create_moderated_profiles_table.php b/database/migrations/2024_10_15_044935_create_moderated_profiles_table.php index 2aa9580a5..90fd22ffc 100644 --- a/database/migrations/2024_10_15_044935_create_moderated_profiles_table.php +++ b/database/migrations/2024_10_15_044935_create_moderated_profiles_table.php @@ -1,11 +1,11 @@ whereAction('admin.user.delete')->get(); - foreach($logs as $log) { + foreach ($logs as $log) { $profile = Profile::withTrashed()->find($log->object_id); - if(!$profile || $profile->private_key) { + if (! $profile || $profile->private_key) { continue; } ModeratedProfile::updateOrCreate([ diff --git a/database/migrations/2025_01_18_061532_fix_local_statuses.php b/database/migrations/2025_01_18_061532_fix_local_statuses.php index 06b3b9fb1..1ba71c533 100644 --- a/database/migrations/2025_01_18_061532_fix_local_statuses.php +++ b/database/migrations/2025_01_18_061532_fix_local_statuses.php @@ -1,8 +1,6 @@