Skip to content

Commit

Permalink
remove unused "{added,deleted}_files" columns in the pulls table
Browse files Browse the repository at this point in the history
  • Loading branch information
TicClick committed Apr 16, 2021
1 parent c37bf4f commit 5b15bb8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
27 changes: 27 additions & 0 deletions alembic/versions/424c7bd5c88c_remove_file_count_columns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
remove_file_count_columns
Revision ID: 424c7bd5c88c
Revises: 5de1a9f1e6fa
Create Date: 2021-04-17 00:52:45.990998
"""

from alembic import op
import sqlalchemy as sql


# revision identifiers, used by Alembic.
revision = '424c7bd5c88c'
down_revision = '5de1a9f1e6fa'
branch_labels = None
depends_on = None


def upgrade():
op.drop_column("pulls", "added_files")
op.drop_column("pulls", "deleted_files")


def downgrade():
op.add_column("pulls", sql.Column("added_files", sql.Integer, nullable=False, default=0))
op.add_column("pulls", sql.Column("deleted_files", sql.Integer, nullable=False, default=0))
4 changes: 0 additions & 4 deletions librarian/storage/models/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ class Pull(base.Base):
commits = sql.Column(sql.Integer, nullable=False)
user_login = sql.Column(sql.String(USER_LOGIN_LEN), nullable=False)
user_id = sql.Column(sql.Integer, nullable=False)

# TODO: these fields were designed for a more rich representation and are probably not needed anymore
added_files = sql.Column(sql.Integer, nullable=False, default=0)
deleted_files = sql.Column(sql.Integer, nullable=False, default=0)
changed_files = sql.Column(sql.Integer, nullable=False, default=0)

assignees_logins = sql.Column(sql.JSON, default=[])
Expand Down

0 comments on commit 5b15bb8

Please sign in to comment.