Skip to content

Commit

Permalink
Add sequencing times for PacBio run (#3530)(patch)
Browse files Browse the repository at this point in the history
## Description
Add the following fields to the `PacBioSequencingRun` db model:
- run_started_at
- run_completed_at

Remove `movie_time_hours`

Create the alembic migration
  • Loading branch information
diitaz93 authored Aug 7, 2024
1 parent f221714 commit a284173
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""Add sequencing times PacBio
Revision ID: 817cf7fea40d
Revises: 601a2f272754
Create Date: 2024-08-07 10:19:57.450266
"""

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "817cf7fea40d"
down_revision = "601a2f272754"
branch_labels = None
depends_on = None


def upgrade():
op.add_column(
"pacbio_sequencing_run", sa.Column("run_started_at", sa.DateTime(), nullable=True)
)
op.add_column(
"pacbio_sequencing_run",
sa.Column("run_completed_at", sa.DateTime(), nullable=True),
)
op.drop_column("pacbio_sequencing_run", "movie_time_hours")


def downgrade():
op.add_column(
"pacbio_sequencing_run",
sa.Column("movie_time_hours", sa.Integer(), nullable=True),
)
op.drop_column("pacbio_sequencing_run", "run_completed_at")
op.drop_column("pacbio_sequencing_run", "run_started_at")
3 changes: 2 additions & 1 deletion cg/store/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,8 @@ class PacBioSequencingRun(InstrumentRun):
id: Mapped[int] = mapped_column(ForeignKey("instrument_run.id"), primary_key=True)
well: Mapped[Str32]
plate: Mapped[int]
movie_time_hours: Mapped[int]
started_at: Mapped[datetime | None]
completed_at: Mapped[datetime | None]
movie_name: Mapped[Str32]
hifi_reads: Mapped[BigInt]
hifi_yield: Mapped[BigInt]
Expand Down

0 comments on commit a284173

Please sign in to comment.