]> Untitled Git - lemmy.git/commit
Adding SQL format checking via `pg_format` / pgFormatter (#3740)
authorDessalines <dessalines@users.noreply.github.com>
Wed, 2 Aug 2023 16:44:51 +0000 (12:44 -0400)
committerGitHub <noreply@github.com>
Wed, 2 Aug 2023 16:44:51 +0000 (12:44 -0400)
commitbe1389420b9dc4516f1e9b3e82637f84919a438e
tree54e69d8666b568e83292f6b1c81cef5bc48f3098
parentb4380cb548f507ab53fa0808ab21d8270646cb36
Adding SQL format checking via `pg_format` / pgFormatter (#3740)

* SQL format checking, 1.

* SQL format checking, 2.

* SQL format checking, 3.

* SQL format checking, 4.

* SQL format checking, 5.

* Running pg_format

* Getting rid of comment.

* Upping pg_format version.

* Using git ls-files for sql format check.

* Fixing sql lints.

* Addressing PR comments.
341 files changed:
.woodpecker.yml
migrations/00000000000000_diesel_initial_setup/down.sql
migrations/00000000000000_diesel_initial_setup/up.sql
migrations/2019-02-26-002946_create_user/down.sql
migrations/2019-02-26-002946_create_user/up.sql
migrations/2019-02-27-170003_create_community/down.sql
migrations/2019-02-27-170003_create_community/up.sql
migrations/2019-03-03-163336_create_post/down.sql
migrations/2019-03-03-163336_create_post/up.sql
migrations/2019-03-05-233828_create_comment/down.sql
migrations/2019-03-05-233828_create_comment/up.sql
migrations/2019-03-30-212058_create_post_view/down.sql
migrations/2019-03-30-212058_create_post_view/up.sql
migrations/2019-04-03-155205_create_community_view/down.sql
migrations/2019-04-03-155205_create_community_view/up.sql
migrations/2019-04-03-155309_create_comment_view/down.sql
migrations/2019-04-03-155309_create_comment_view/up.sql
migrations/2019-04-07-003142_create_moderation_logs/down.sql
migrations/2019-04-07-003142_create_moderation_logs/up.sql
migrations/2019-04-08-015947_create_user_view/down.sql
migrations/2019-04-08-015947_create_user_view/up.sql
migrations/2019-04-11-144915_create_mod_views/down.sql
migrations/2019-04-11-144915_create_mod_views/up.sql
migrations/2019-04-29-175834_add_delete_columns/down.sql
migrations/2019-04-29-175834_add_delete_columns/up.sql
migrations/2019-05-02-051656_community_view_hot_rank/down.sql
migrations/2019-05-02-051656_community_view_hot_rank/up.sql
migrations/2019-06-01-222649_remove_admin/down.sql
migrations/2019-06-01-222649_remove_admin/up.sql
migrations/2019-08-11-000918_add_nsfw_columns/down.sql
migrations/2019-08-11-000918_add_nsfw_columns/up.sql
migrations/2019-08-29-040006_add_community_count/down.sql
migrations/2019-08-29-040006_add_community_count/up.sql
migrations/2019-09-05-230317_add_mod_ban_views/down.sql
migrations/2019-09-05-230317_add_mod_ban_views/up.sql
migrations/2019-09-09-042010_add_stickied_posts/down.sql
migrations/2019-09-09-042010_add_stickied_posts/up.sql
migrations/2019-10-15-181630_add_themes/down.sql
migrations/2019-10-15-181630_add_themes/up.sql
migrations/2019-10-19-052737_create_user_mention/down.sql
migrations/2019-10-19-052737_create_user_mention/up.sql
migrations/2019-10-21-011237_add_default_sorts/down.sql
migrations/2019-10-21-011237_add_default_sorts/up.sql
migrations/2019-10-24-002614_create_password_reset_request/down.sql
migrations/2019-10-24-002614_create_password_reset_request/up.sql
migrations/2019-12-09-060754_add_lang/down.sql
migrations/2019-12-09-060754_add_lang/up.sql
migrations/2019-12-11-181820_add_site_fields/down.sql
migrations/2019-12-11-181820_add_site_fields/up.sql
migrations/2019-12-29-164820_add_avatar/down.sql
migrations/2019-12-29-164820_add_avatar/up.sql
migrations/2020-01-01-200418_add_email_to_user_view/down.sql
migrations/2020-01-01-200418_add_email_to_user_view/up.sql
migrations/2020-01-02-172755_add_show_avatar_and_email_notifications_to_user/down.sql
migrations/2020-01-02-172755_add_show_avatar_and_email_notifications_to_user/up.sql
migrations/2020-01-11-012452_add_indexes/down.sql
migrations/2020-01-11-012452_add_indexes/up.sql
migrations/2020-01-13-025151_create_materialized_views/down.sql
migrations/2020-01-13-025151_create_materialized_views/up.sql
migrations/2020-01-21-001001_create_private_message/down.sql
migrations/2020-01-21-001001_create_private_message/up.sql
migrations/2020-01-29-011901_create_reply_materialized_view/down.sql
migrations/2020-01-29-011901_create_reply_materialized_view/up.sql
migrations/2020-01-29-030825_create_user_mention_materialized_view/down.sql
migrations/2020-01-29-030825_create_user_mention_materialized_view/up.sql
migrations/2020-02-02-004806_add_case_insensitive_usernames/down.sql
migrations/2020-02-02-004806_add_case_insensitive_usernames/up.sql
migrations/2020-02-06-165953_change_post_title_length/down.sql
migrations/2020-02-06-165953_change_post_title_length/up.sql
migrations/2020-02-07-210055_add_comment_subscribed/down.sql
migrations/2020-02-07-210055_add_comment_subscribed/up.sql
migrations/2020-02-08-145624_add_post_newest_activity_time/down.sql
migrations/2020-02-08-145624_add_post_newest_activity_time/up.sql
migrations/2020-03-06-202329_add_post_iframely_data/down.sql
migrations/2020-03-06-202329_add_post_iframely_data/up.sql
migrations/2020-03-26-192410_add_activitypub_tables/down.sql
migrations/2020-03-26-192410_add_activitypub_tables/up.sql
migrations/2020-04-03-194936_add_activitypub_for_posts_and_comments/down.sql
migrations/2020-04-03-194936_add_activitypub_for_posts_and_comments/up.sql
migrations/2020-04-07-135912_add_user_community_apub_constraints/down.sql
migrations/2020-04-07-135912_add_user_community_apub_constraints/up.sql
migrations/2020-04-14-163701_update_views_for_activitypub/down.sql
migrations/2020-04-14-163701_update_views_for_activitypub/up.sql
migrations/2020-04-21-123957_remove_unique_user_constraints/down.sql
migrations/2020-04-21-123957_remove_unique_user_constraints/up.sql
migrations/2020-05-05-210233_add_activitypub_for_private_messages/down.sql
migrations/2020-05-05-210233_add_activitypub_for_private_messages/up.sql
migrations/2020-06-30-135809_remove_mat_views/down.sql
migrations/2020-06-30-135809_remove_mat_views/up.sql
migrations/2020-07-08-202609_add_creator_published/down.sql
migrations/2020-07-08-202609_add_creator_published/up.sql
migrations/2020-07-12-100442_add_post_title_to_comments_view/down.sql
migrations/2020-07-12-100442_add_post_title_to_comments_view/up.sql
migrations/2020-07-18-234519_add_unique_community_user_actor_ids/down.sql
migrations/2020-07-18-234519_add_unique_community_user_actor_ids/up.sql
migrations/2020-08-03-000110_add_preferred_usernames_banners_and_icons/down.sql
migrations/2020-08-03-000110_add_preferred_usernames_banners_and_icons/up.sql
migrations/2020-08-06-205355_update_community_post_count/down.sql
migrations/2020-08-06-205355_update_community_post_count/up.sql
migrations/2020-08-25-132005_add_unique_ap_ids/down.sql
migrations/2020-08-25-132005_add_unique_ap_ids/up.sql
migrations/2020-09-07-231141_add_migration_utils/down.sql
migrations/2020-09-07-231141_add_migration_utils/up.sql
migrations/2020-10-07-234221_fix_fast_triggers/down.sql
migrations/2020-10-07-234221_fix_fast_triggers/up.sql
migrations/2020-10-10-035723_fix_fast_triggers_2/down.sql
migrations/2020-10-10-035723_fix_fast_triggers_2/up.sql
migrations/2020-10-13-212240_create_report_tables/down.sql
migrations/2020-10-13-212240_create_report_tables/up.sql
migrations/2020-10-23-115011_activity_ap_id_column/down.sql
migrations/2020-10-23-115011_activity_ap_id_column/up.sql
migrations/2020-11-05-152724_activity_remove_user_id/down.sql
migrations/2020-11-05-152724_activity_remove_user_id/up.sql
migrations/2020-11-10-150835_community_follower_pending/down.sql
migrations/2020-11-10-150835_community_follower_pending/up.sql
migrations/2020-11-26-134531_delete_user/down.sql
migrations/2020-11-26-134531_delete_user/up.sql
migrations/2020-12-02-152437_create_site_aggregates/down.sql
migrations/2020-12-02-152437_create_site_aggregates/up.sql
migrations/2020-12-03-035643_create_user_aggregates/down.sql
migrations/2020-12-03-035643_create_user_aggregates/up.sql
migrations/2020-12-04-183345_create_community_aggregates/down.sql
migrations/2020-12-04-183345_create_community_aggregates/up.sql
migrations/2020-12-10-152350_create_post_aggregates/down.sql
migrations/2020-12-10-152350_create_post_aggregates/up.sql
migrations/2020-12-14-020038_create_comment_aggregates/down.sql
migrations/2020-12-14-020038_create_comment_aggregates/up.sql
migrations/2020-12-17-030456_create_alias_views/down.sql
migrations/2020-12-17-030456_create_alias_views/up.sql
migrations/2020-12-17-031053_remove_fast_tables_and_views/down.sql
migrations/2020-12-17-031053_remove_fast_tables_and_views/up.sql
migrations/2021-01-05-200932_add_hot_rank_indexes/down.sql
migrations/2021-01-05-200932_add_hot_rank_indexes/up.sql
migrations/2021-01-26-173850_default_actor_id/down.sql
migrations/2021-01-26-173850_default_actor_id/up.sql
migrations/2021-01-27-202728_active_users_monthly/down.sql
migrations/2021-01-27-202728_active_users_monthly/up.sql
migrations/2021-01-31-050334_add_forum_sort_index/down.sql
migrations/2021-01-31-050334_add_forum_sort_index/up.sql
migrations/2021-02-02-153240_apub_columns/down.sql
migrations/2021-02-02-153240_apub_columns/up.sql
migrations/2021-02-10-164051_add_new_comments_sort_index/down.sql
migrations/2021-02-10-164051_add_new_comments_sort_index/up.sql
migrations/2021-02-13-210612_set_correct_aggregates_time_columns/down.sql
migrations/2021-02-13-210612_set_correct_aggregates_time_columns/up.sql
migrations/2021-02-25-112959_remove-categories/down.sql
migrations/2021-02-25-112959_remove-categories/up.sql
migrations/2021-02-28-162616_clean_empty_post_urls/down.sql
migrations/2021-02-28-162616_clean_empty_post_urls/up.sql
migrations/2021-03-04-040229_clean_icon_urls/down.sql
migrations/2021-03-04-040229_clean_icon_urls/up.sql
migrations/2021-03-09-171136_split_user_table_2/down.sql
migrations/2021-03-09-171136_split_user_table_2/up.sql
migrations/2021-03-19-014144_add_col_local_user_validator_time/down.sql
migrations/2021-03-19-014144_add_col_local_user_validator_time/up.sql
migrations/2021-03-20-185321_move_matrix_id_to_person/down.sql
migrations/2021-03-20-185321_move_matrix_id_to_person/up.sql
migrations/2021-03-31-103917_add_show_score_setting/down.sql
migrations/2021-03-31-103917_add_show_score_setting/up.sql
migrations/2021-03-31-105915_add_bot_account/down.sql
migrations/2021-03-31-105915_add_bot_account/up.sql
migrations/2021-03-31-144349_add_site_short_description/down.sql
migrations/2021-03-31-144349_add_site_short_description/up.sql
migrations/2021-04-01-173552_rename_preferred_username_to_display_name/down.sql
migrations/2021-04-01-173552_rename_preferred_username_to_display_name/up.sql
migrations/2021-04-01-181826_add_community_agg_active_monthly_index/down.sql
migrations/2021-04-01-181826_add_community_agg_active_monthly_index/up.sql
migrations/2021-04-02-021422_remove_community_creator/down.sql
migrations/2021-04-02-021422_remove_community_creator/up.sql
migrations/2021-04-20-155001_limit-admins-create-community/down.sql
migrations/2021-04-20-155001_limit-admins-create-community/up.sql
migrations/2021-04-24-174047_add_show_read_post_setting/down.sql
migrations/2021-04-24-174047_add_show_read_post_setting/up.sql
migrations/2021-07-19-130929_add_show_new_post_notifs_setting/down.sql
migrations/2021-07-19-130929_add_show_new_post_notifs_setting/up.sql
migrations/2021-07-20-102033_actor_name_length/down.sql
migrations/2021-07-20-102033_actor_name_length/up.sql
migrations/2021-08-02-002342_comment_count_fixes/down.sql
migrations/2021-08-02-002342_comment_count_fixes/up.sql
migrations/2021-08-04-223559_create_user_community_block/down.sql
migrations/2021-08-04-223559_create_user_community_block/up.sql
migrations/2021-08-16-004209_fix_remove_bots_from_aggregates/down.sql
migrations/2021-08-16-004209_fix_remove_bots_from_aggregates/up.sql
migrations/2021-08-17-210508_create_mod_transfer_community/down.sql
migrations/2021-08-17-210508_create_mod_transfer_community/up.sql
migrations/2021-09-20-112945_jwt-secret/down.sql
migrations/2021-09-20-112945_jwt-secret/up.sql
migrations/2021-10-01-141650_create_admin_purge/down.sql
migrations/2021-10-01-141650_create_admin_purge/up.sql
migrations/2021-11-22-135324_add_activity_ap_id_index/down.sql
migrations/2021-11-22-135324_add_activity_ap_id_index/up.sql
migrations/2021-11-22-143904_add_required_public_key/down.sql
migrations/2021-11-22-143904_add_required_public_key/up.sql
migrations/2021-11-23-031528_add_report_published_index/down.sql
migrations/2021-11-23-031528_add_report_published_index/up.sql
migrations/2021-11-23-132840_email_verification/down.sql
migrations/2021-11-23-132840_email_verification/up.sql
migrations/2021-11-23-153753_add_invite_only_columns/down.sql
migrations/2021-11-23-153753_add_invite_only_columns/up.sql
migrations/2021-12-09-225529_add_published_to_email_verification/down.sql
migrations/2021-12-09-225529_add_published_to_email_verification/up.sql
migrations/2021-12-14-181537_add_temporary_bans/down.sql
migrations/2021-12-14-181537_add_temporary_bans/up.sql
migrations/2022-01-04-034553_add_hidden_column/down.sql
migrations/2022-01-04-034553_add_hidden_column/up.sql
migrations/2022-01-20-160328_remove_site_creator/down.sql
migrations/2022-01-20-160328_remove_site_creator/up.sql
migrations/2022-01-28-104106_instance-actor/down.sql
migrations/2022-01-28-104106_instance-actor/up.sql
migrations/2022-02-01-154240_add_community_title_index/down.sql
migrations/2022-02-01-154240_add_community_title_index/up.sql
migrations/2022-02-18-210946_default_theme/down.sql
migrations/2022-02-18-210946_default_theme/up.sql
migrations/2022-04-04-183652_update_community_aggregates_on_soft_delete/down.sql
migrations/2022-04-04-183652_update_community_aggregates_on_soft_delete/up.sql
migrations/2022-04-11-210137_fix_unique_changeme/down.sql
migrations/2022-04-11-210137_fix_unique_changeme/up.sql
migrations/2022-04-12-114352_default_post_listing_type/down.sql
migrations/2022-04-12-114352_default_post_listing_type/up.sql
migrations/2022-04-12-185205_change_default_listing_type_to_local/down.sql
migrations/2022-04-12-185205_change_default_listing_type_to_local/up.sql
migrations/2022-04-19-111004_default_require_application/down.sql
migrations/2022-04-19-111004_default_require_application/up.sql
migrations/2022-04-26-105145_only_mod_can_post/down.sql
migrations/2022-04-26-105145_only_mod_can_post/up.sql
migrations/2022-05-19-153931_legal-information/down.sql
migrations/2022-05-19-153931_legal-information/up.sql
migrations/2022-05-20-135341_embed-url/down.sql
migrations/2022-05-20-135341_embed-url/up.sql
migrations/2022-06-12-012121_add_site_hide_modlog_names/down.sql
migrations/2022-06-12-012121_add_site_hide_modlog_names/up.sql
migrations/2022-06-13-124806_post_report_name_length/down.sql
migrations/2022-06-13-124806_post_report_name_length/up.sql
migrations/2022-06-21-123144_language-tags/down.sql
migrations/2022-06-21-123144_language-tags/up.sql
migrations/2022-07-07-182650_comment_ltrees/down.sql
migrations/2022-07-07-182650_comment_ltrees/up.sql
migrations/2022-08-04-150644_add_application_email_admins/down.sql
migrations/2022-08-04-150644_add_application_email_admins/up.sql
migrations/2022-08-04-214722_add_distinguished_comment/down.sql
migrations/2022-08-04-214722_add_distinguished_comment/up.sql
migrations/2022-08-05-203502_add_person_post_aggregates/down.sql
migrations/2022-08-05-203502_add_person_post_aggregates/up.sql
migrations/2022-08-22-193848_comment-language-tags/down.sql
migrations/2022-08-22-193848_comment-language-tags/up.sql
migrations/2022-09-07-113813_drop_ccnew_indexes_function/down.sql
migrations/2022-09-07-113813_drop_ccnew_indexes_function/up.sql
migrations/2022-09-07-114618_pm-reports/down.sql
migrations/2022-09-07-114618_pm-reports/up.sql
migrations/2022-09-08-102358_site-and-community-languages/down.sql
migrations/2022-09-08-102358_site-and-community-languages/up.sql
migrations/2022-09-24-161829_remove_table_aliases/down.sql
migrations/2022-09-24-161829_remove_table_aliases/up.sql
migrations/2022-10-06-183632_move_blocklist_to_db/down.sql
migrations/2022-10-06-183632_move_blocklist_to_db/up.sql
migrations/2022-11-13-181529_create_taglines/down.sql
migrations/2022-11-13-181529_create_taglines/up.sql
migrations/2022-11-20-032430_sticky_local/down.sql
migrations/2022-11-20-032430_sticky_local/up.sql
migrations/2022-11-21-143249_remove-federation-settings/down.sql
migrations/2022-11-21-143249_remove-federation-settings/up.sql
migrations/2022-11-21-204256_user-following/down.sql
migrations/2022-11-21-204256_user-following/up.sql
migrations/2022-12-05-110642_registration_mode/down.sql
migrations/2022-12-05-110642_registration_mode/up.sql
migrations/2023-01-17-165819_cleanup_post_aggregates_indexes/down.sql
migrations/2023-01-17-165819_cleanup_post_aggregates_indexes/up.sql
migrations/2023-02-01-012747_fix_active_index/down.sql
migrations/2023-02-01-012747_fix_active_index/up.sql
migrations/2023-02-05-102549_drop-site-federation-debug/down.sql
migrations/2023-02-05-102549_drop-site-federation-debug/up.sql
migrations/2023-02-07-030958_community-collections/down.sql
migrations/2023-02-07-030958_community-collections/up.sql
migrations/2023-02-11-173347_custom_emojis/down.sql
migrations/2023-02-11-173347_custom_emojis/up.sql
migrations/2023-02-13-172528_add_report_email_admins/down.sql
migrations/2023-02-13-172528_add_report_email_admins/up.sql
migrations/2023-02-13-221303_add_instance_software_and_version/down.sql
migrations/2023-02-13-221303_add_instance_software_and_version/up.sql
migrations/2023-02-15-212546_add_post_comment_saved_indexes/down.sql
migrations/2023-02-15-212546_add_post_comment_saved_indexes/up.sql
migrations/2023-02-16-194139_add_totp_secret/down.sql
migrations/2023-02-16-194139_add_totp_secret/up.sql
migrations/2023-04-14-175955_add_listingtype_sorttype_enums/down.sql
migrations/2023-04-14-175955_add_listingtype_sorttype_enums/up.sql
migrations/2023-04-23-164732_add_person_details_indexes/down.sql
migrations/2023-04-23-164732_add_person_details_indexes/up.sql
migrations/2023-05-10-095739_force_enable_undetermined_language/up.sql
migrations/2023-06-06-104440_index_post_url/down.sql
migrations/2023-06-06-104440_index_post_url/up.sql
migrations/2023-06-07-105918_add_hot_rank_columns/down.sql
migrations/2023-06-07-105918_add_hot_rank_columns/up.sql
migrations/2023-06-17-175955_add_listingtype_sorttype_hour_enums/down.sql
migrations/2023-06-17-175955_add_listingtype_sorttype_hour_enums/up.sql
migrations/2023-06-19-055530_add_retry_worker_setting/down.sql
migrations/2023-06-19-055530_add_retry_worker_setting/up.sql
migrations/2023-06-19-120700_no_double_deletion/down.sql
migrations/2023-06-19-120700_no_double_deletion/up.sql
migrations/2023-06-20-191145_add_listingtype_sorttype_3_6_9_months_enums/down.sql
migrations/2023-06-20-191145_add_listingtype_sorttype_3_6_9_months_enums/up.sql
migrations/2023-06-21-153242_add_captcha/down.sql
migrations/2023-06-21-153242_add_captcha/up.sql
migrations/2023-06-22-051755_fix_local_communities_marked_non_local/down.sql
migrations/2023-06-22-051755_fix_local_communities_marked_non_local/up.sql
migrations/2023-06-22-101245_increase_user_theme_column_size/down.sql
migrations/2023-06-22-101245_increase_user_theme_column_size/up.sql
migrations/2023-06-24-072904_add_open_links_in_new_tab_setting/down.sql
migrations/2023-06-24-072904_add_open_links_in_new_tab_setting/up.sql
migrations/2023-06-24-185942_aggegates_published_indexes/down.sql
migrations/2023-06-24-185942_aggegates_published_indexes/up.sql
migrations/2023-06-27-065106_add_ui_settings/down.sql
migrations/2023-06-27-065106_add_ui_settings/up.sql
migrations/2023-07-04-153335_add_optimized_indexes/down.sql
migrations/2023-07-04-153335_add_optimized_indexes/up.sql
migrations/2023-07-05-000058_person-admin/down.sql
migrations/2023-07-05-000058_person-admin/up.sql
migrations/2023-07-06-151124_hot-rank-future/down.sql
migrations/2023-07-06-151124_hot-rank-future/up.sql
migrations/2023-07-08-101154_fix_soft_delete_aggregates/down.sql
migrations/2023-07-08-101154_fix_soft_delete_aggregates/up.sql
migrations/2023-07-10-075550_add-infinite-scroll-setting/down.sql
migrations/2023-07-10-075550_add-infinite-scroll-setting/up.sql
migrations/2023-07-11-084714_receive_activity_table/down.sql
migrations/2023-07-11-084714_receive_activity_table/up.sql
migrations/2023-07-14-154840_add_optimized_indexes_published/down.sql
migrations/2023-07-14-154840_add_optimized_indexes_published/up.sql
migrations/2023-07-14-215339_aggregates_nonzero_indexes/down.sql
migrations/2023-07-14-215339_aggregates_nonzero_indexes/up.sql
migrations/2023-07-18-082614_post_aggregates_community_id/down.sql
migrations/2023-07-18-082614_post_aggregates_community_id/up.sql
migrations/2023-07-19-163511_comment_sort_hot_rank_then_score/down.sql
migrations/2023-07-19-163511_comment_sort_hot_rank_then_score/up.sql
migrations/2023-07-24-232635_trigram-index/up.sql
migrations/2023-07-26-000217_create_controversial_indexes/down.sql
migrations/2023-07-26-000217_create_controversial_indexes/up.sql
migrations/2023-07-26-222023_site-aggregates-one/down.sql
migrations/2023-07-26-222023_site-aggregates-one/up.sql
migrations/2023-07-27-134652_remove-expensive-broken-trigger/down.sql
migrations/2023-07-27-134652_remove-expensive-broken-trigger/up.sql
scripts/lint.sh [moved from scripts/fix-clippy.sh with 87% similarity]
scripts/sql_format_check.sh [new file with mode: 0755]