From 88f90fc267b21fd3b4f2ae7f747a4d9b3b7c9edd 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 --- collectoss/application/db/models/data.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/collectoss/application/db/models/data.py b/collectoss/application/db/models/data.py index aa4d30482..866fe99fa 100644 --- a/collectoss/application/db/models/data.py +++ b/collectoss/application/db/models/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 8c79f77f8b2f1e327336fa8c4fe321fd21a1c8d6 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 --- collectoss/application/db/models/data.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/collectoss/application/db/models/data.py b/collectoss/application/db/models/data.py index 866fe99fa..aa31c18bb 100644 --- a/collectoss/application/db/models/data.py +++ b/collectoss/application/db/models/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 1f01a635e3e7d5ab4f29c84c60850630a59850ef 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 collectoss/application/schema/alembic/versions/39_remove_unused_api_url_fields_in_.py diff --git a/collectoss/application/schema/alembic/versions/39_remove_unused_api_url_fields_in_.py b/collectoss/application/schema/alembic/versions/39_remove_unused_api_url_fields_in_.py new file mode 100644 index 000000000..be328529c --- /dev/null +++ b/collectoss/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 ###