From 4b54cbb41bea855f3035377b6d9ce7c855a90a4d Mon Sep 17 00:00:00 2001 From: Adrian Edwards Date: Mon, 2 Mar 2026 15:46:53 -0500 Subject: [PATCH 1/3] remove url fields that can be recreated later Signed-off-by: Adrian Edwards --- augur/application/db/models/augur_data.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/augur/application/db/models/augur_data.py b/augur/application/db/models/augur_data.py index 095d16c3e5..7d286f2f38 100644 --- a/augur/application/db/models/augur_data.py +++ b/augur/application/db/models/augur_data.py @@ -223,15 +223,6 @@ class Contributor(Base): gh_node_id = Column(String) gh_avatar_url = Column(String) gh_gravatar_id = Column(String) - gh_followers_url = Column(String) - gh_following_url = Column(String) - gh_gists_url = Column(String) - gh_starred_url = Column(String) - gh_subscriptions_url = Column(String) - gh_organizations_url = Column(String) - gh_repos_url = Column(String) - gh_events_url = Column(String) - gh_received_events_url = Column(String) gh_type = Column(String) gh_site_admin = Column(String) gl_web_url = Column( From f3db49a17197a503c39471760a7e80c7eaa534bd Mon Sep 17 00:00:00 2001 From: Adrian Edwards Date: Mon, 2 Mar 2026 15:47:43 -0500 Subject: [PATCH 2/3] add comments to remaining URLs to document why they are kept around despite this being less efficient Signed-off-by: Adrian Edwards --- augur/application/db/models/augur_data.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/augur/application/db/models/augur_data.py b/augur/application/db/models/augur_data.py index 7d286f2f38..d8e269516c 100644 --- a/augur/application/db/models/augur_data.py +++ b/augur/application/db/models/augur_data.py @@ -218,8 +218,14 @@ class Contributor(Base): String, comment="populated with the github user name for github originated data. ", ) - gh_url = Column(String) - gh_html_url = Column(String) + gh_url = Column( + String, + comment="Convenience url to aid in manually debugging database and sanity checking against GitHub API results (tools like dbeaver make links like this clickable). May be removed in the future." + ) + gh_html_url = Column( + String, + comment="Convenience url to aid in manually debugging database and sanity checking against GitHub API results (tools like dbeaver make links like this clickable). May be removed in the future." + ) gh_node_id = Column(String) gh_avatar_url = Column(String) gh_gravatar_id = Column(String) From 1fed855c9b69845773c50f92cc5979dc64118bff Mon Sep 17 00:00:00 2001 From: Adrian Edwards Date: Mon, 2 Mar 2026 15:51:41 -0500 Subject: [PATCH 3/3] generate data migration for this change Signed-off-by: Adrian Edwards --- .../39_remove_unused_api_url_fields_in_.py | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 augur/application/schema/alembic/versions/39_remove_unused_api_url_fields_in_.py diff --git a/augur/application/schema/alembic/versions/39_remove_unused_api_url_fields_in_.py b/augur/application/schema/alembic/versions/39_remove_unused_api_url_fields_in_.py new file mode 100644 index 0000000000..be328529cf --- /dev/null +++ b/augur/application/schema/alembic/versions/39_remove_unused_api_url_fields_in_.py @@ -0,0 +1,66 @@ +"""remove unused api url fields in contributors table + +Revision ID: 39 +Revises: 38 +Create Date: 2026-03-02 15:49:34.325165 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '39' +down_revision = '38' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('contributors', 'gh_url', + existing_type=sa.VARCHAR(), + comment='Convenience url to aid in manually debugging database and sanity checking against GitHub API results (tools like dbeaver make links like this clickable). May be removed in the future.', + existing_nullable=True, + schema='augur_data') + op.alter_column('contributors', 'gh_html_url', + existing_type=sa.VARCHAR(), + comment='Convenience url to aid in manually debugging database and sanity checking against GitHub API results (tools like dbeaver make links like this clickable). May be removed in the future.', + existing_nullable=True, + schema='augur_data') + op.drop_column('contributors', 'gh_starred_url', schema='augur_data') + op.drop_column('contributors', 'gh_organizations_url', schema='augur_data') + op.drop_column('contributors', 'gh_repos_url', schema='augur_data') + op.drop_column('contributors', 'gh_followers_url', schema='augur_data') + op.drop_column('contributors', 'gh_subscriptions_url', schema='augur_data') + op.drop_column('contributors', 'gh_received_events_url', schema='augur_data') + op.drop_column('contributors', 'gh_gists_url', schema='augur_data') + op.drop_column('contributors', 'gh_following_url', schema='augur_data') + op.drop_column('contributors', 'gh_events_url', schema='augur_data') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('contributors', sa.Column('gh_events_url', sa.VARCHAR(), autoincrement=False, nullable=True), schema='augur_data') + op.add_column('contributors', sa.Column('gh_following_url', sa.VARCHAR(), autoincrement=False, nullable=True), schema='augur_data') + op.add_column('contributors', sa.Column('gh_gists_url', sa.VARCHAR(), autoincrement=False, nullable=True), schema='augur_data') + op.add_column('contributors', sa.Column('gh_received_events_url', sa.VARCHAR(), autoincrement=False, nullable=True), schema='augur_data') + op.add_column('contributors', sa.Column('gh_subscriptions_url', sa.VARCHAR(), autoincrement=False, nullable=True), schema='augur_data') + op.add_column('contributors', sa.Column('gh_followers_url', sa.VARCHAR(), autoincrement=False, nullable=True), schema='augur_data') + op.add_column('contributors', sa.Column('gh_repos_url', sa.VARCHAR(), autoincrement=False, nullable=True), schema='augur_data') + op.add_column('contributors', sa.Column('gh_organizations_url', sa.VARCHAR(), autoincrement=False, nullable=True), schema='augur_data') + op.add_column('contributors', sa.Column('gh_starred_url', sa.VARCHAR(), autoincrement=False, nullable=True), schema='augur_data') + op.alter_column('contributors', 'gh_html_url', + existing_type=sa.VARCHAR(), + comment=None, + existing_comment='Convenience url to aid in manually debugging database and sanity checking against GitHub API results (tools like dbeaver make links like this clickable). May be removed in the future.', + existing_nullable=True, + schema='augur_data') + op.alter_column('contributors', 'gh_url', + existing_type=sa.VARCHAR(), + comment=None, + existing_comment='Convenience url to aid in manually debugging database and sanity checking against GitHub API results (tools like dbeaver make links like this clickable). May be removed in the future.', + existing_nullable=True, + schema='augur_data') + # ### end Alembic commands ###