From 4e52d9d74b9048a905acdb6b8a05daa310174ca1 Mon Sep 17 00:00:00 2001 From: ChristianOertlin Date: Mon, 27 May 2024 09:15:50 +0200 Subject: [PATCH] fix(change coltype illumina sequencing run) (#3277) (patch) # Description Change column type from float to biginteger --- ...2024_05_27_ec2db27c06e3_adjust_col_type.py | 35 +++++++++++++++++++ cg/store/models.py | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 alembic/versions/2024_05_27_ec2db27c06e3_adjust_col_type.py diff --git a/alembic/versions/2024_05_27_ec2db27c06e3_adjust_col_type.py b/alembic/versions/2024_05_27_ec2db27c06e3_adjust_col_type.py new file mode 100644 index 0000000000..1153fafab9 --- /dev/null +++ b/alembic/versions/2024_05_27_ec2db27c06e3_adjust_col_type.py @@ -0,0 +1,35 @@ +"""adjust-col-type + +Revision ID: ec2db27c06e3 +Revises: 18e3b2aba252 +Create Date: 2024-05-27 08:47:58.856322 + +""" + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = "ec2db27c06e3" +down_revision = "18e3b2aba252" +branch_labels = None +depends_on = None + + +def upgrade(): + op.alter_column( + table_name="illumina_sequencing_run", + column_name="yield_q30", + type_=sa.types.BigInteger(), + existing_type=sa.types.Float(), + ) + + +def downgrade(): + op.alter_column( + table_name="illumina_sequencing_run", + column_name="yield_q30", + type_=sa.types.Float(), + existing_type=sa.types.BigInteger(), + ) diff --git a/cg/store/models.py b/cg/store/models.py index 30b9dde672..678c24d9b6 100644 --- a/cg/store/models.py +++ b/cg/store/models.py @@ -1040,7 +1040,7 @@ class IlluminaSequencingRun(InstrumentRun): percent_q30: Mapped[Num_6_2 | None] mean_quality_score: Mapped[Num_6_2 | None] total_yield: Mapped[BigInt | None] - yield_q30: Mapped[Num_6_2 | None] + yield_q30: Mapped[BigInt | None] cycles: Mapped[int | None] demultiplexing_software: Mapped[Str32 | None] demultiplexing_software_version: Mapped[Str32 | None]