Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add column to determine if eligible for skip qc #2758

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""add-eligible-for-skip-qc

Revision ID: 79454ff320bf
Revises: b105b426af99
Create Date: 2023-12-11 15:02:40.593762

"""
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "79454ff320bf"
down_revision = "b105b426af99"
branch_labels = None
depends_on = None


def upgrade():
op.add_column(
"application",
sa.Column("is_eligible_for_skip_qc", sa.Boolean(), nullable=False),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be necessary to provide a default value to the column here as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently not

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but maybe a good idea to set it to False as default, not sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit unsure what it would add, given that the script has already been tested and added the column with False as default.

)


def downgrade():
op.drop_column("application", "is_eligible_for_skip_qc")
1 change: 1 addition & 0 deletions cg/server/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class ApplicationView(BaseView):
"sample_concentration",
"priority_processing",
"is_archived",
"is_eligible_for_skip_qc",
]
column_exclude_list = [
"minimum_order",
Expand Down
2 changes: 2 additions & 0 deletions cg/store/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ class Application(Model):
created_at = Column(types.DateTime, default=dt.datetime.now)
updated_at = Column(types.DateTime, onupdate=dt.datetime.now)

is_eligible_for_skip_qc = Column(types.Boolean, default=False, nullable=False)

versions = orm.relationship(
"ApplicationVersion", order_by="ApplicationVersion.version", back_populates="application"
)
Expand Down
Loading