-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from lsst-dm/tickets/DM-44967b
DM-44967: (hotfix) Change vignette field datatypes.
- Loading branch information
Showing
3 changed files
with
246 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
"""fix vignetting | ||
Revision ID: 59776480aa4d | ||
Revises: b801850c5cc9 | ||
Create Date: 2024-06-25 21:29:10.680116+00:00 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import mysql | ||
from sqlalchemy.dialects import oracle | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "59776480aa4d" | ||
down_revision: Union[str, None] = "b801850c5cc9" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"exposure", | ||
"vignette", | ||
existing_type=sa.INTEGER(), | ||
type_=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
comment="Instrument blocked from the sky: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_comment="Instrument blocked from the sky: Unknown = 0, No = 1, Partially = 2, Fully = 3.", | ||
existing_nullable=True, | ||
schema="cdb_latiss", | ||
) | ||
op.alter_column( | ||
"exposure", | ||
"vignette_min", | ||
existing_type=sa.INTEGER(), | ||
type_=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
comment="Lowest amount of instrument vignetting detected during the exposure: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_comment="Minimum value of vignette during the exposure.", | ||
existing_nullable=True, | ||
schema="cdb_latiss", | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"exposure", | ||
"vignette_min", | ||
existing_type=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
type_=sa.INTEGER(), | ||
comment="Minimum value of vignette during the exposure.", | ||
existing_comment="Lowest amount of instrument vignetting detected during the exposure: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_nullable=True, | ||
schema="cdb_latiss", | ||
) | ||
op.alter_column( | ||
"exposure", | ||
"vignette", | ||
existing_type=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
type_=sa.INTEGER(), | ||
comment="Instrument blocked from the sky: Unknown = 0, No = 1, Partially = 2, Fully = 3.", | ||
existing_comment="Instrument blocked from the sky: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_nullable=True, | ||
schema="cdb_latiss", | ||
) | ||
# ### end Alembic commands ### |
82 changes: 82 additions & 0 deletions
82
alembic/lsstcomcam/versions/d54a539aad4d_fix_vignetting.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
"""fix vignetting | ||
Revision ID: d54a539aad4d | ||
Revises: 1b1d80c59d58 | ||
Create Date: 2024-06-25 21:28:51.589042+00:00 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import mysql | ||
from sqlalchemy.dialects import oracle | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "d54a539aad4d" | ||
down_revision: Union[str, None] = "1b1d80c59d58" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"exposure", | ||
"vignette", | ||
existing_type=sa.INTEGER(), | ||
type_=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
comment="Instrument blocked from the sky: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_comment="Instrument blocked from the sky: Unknown = 0, No = 1, Partially = 2, Fully = 3.", | ||
existing_nullable=True, | ||
schema="cdb_lsstcomcam", | ||
) | ||
op.alter_column( | ||
"exposure", | ||
"vignette_min", | ||
existing_type=sa.INTEGER(), | ||
type_=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
comment="Lowest amount of instrument vignetting detected during the exposure: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_comment="Minimum value of vignette during the exposure.", | ||
existing_nullable=True, | ||
schema="cdb_lsstcomcam", | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"exposure", | ||
"vignette_min", | ||
existing_type=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
type_=sa.INTEGER(), | ||
comment="Minimum value of vignette during the exposure.", | ||
existing_comment="Lowest amount of instrument vignetting detected during the exposure: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_nullable=True, | ||
schema="cdb_lsstcomcam", | ||
) | ||
op.alter_column( | ||
"exposure", | ||
"vignette", | ||
existing_type=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
type_=sa.INTEGER(), | ||
comment="Instrument blocked from the sky: Unknown = 0, No = 1, Partially = 2, Fully = 3.", | ||
existing_comment="Instrument blocked from the sky: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_nullable=True, | ||
schema="cdb_lsstcomcam", | ||
) | ||
# ### end Alembic commands ### |
82 changes: 82 additions & 0 deletions
82
alembic/lsstcomcamsim/versions/3f8460378c1e_fix_vignetting.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
"""fix vignetting | ||
Revision ID: 3f8460378c1e | ||
Revises: ef3efe082be3 | ||
Create Date: 2024-06-25 21:29:01.650070+00:00 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import mysql | ||
from sqlalchemy.dialects import oracle | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "3f8460378c1e" | ||
down_revision: Union[str, None] = "ef3efe082be3" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"exposure", | ||
"vignette", | ||
existing_type=sa.INTEGER(), | ||
type_=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
comment="Instrument blocked from the sky: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_comment="Instrument blocked from the sky: Unknown = 0, No = 1, Partially = 2, Fully = 3.", | ||
existing_nullable=True, | ||
schema="cdb_lsstcomcamsim", | ||
) | ||
op.alter_column( | ||
"exposure", | ||
"vignette_min", | ||
existing_type=sa.INTEGER(), | ||
type_=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
comment="Lowest amount of instrument vignetting detected during the exposure: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_comment="Minimum value of vignette during the exposure.", | ||
existing_nullable=True, | ||
schema="cdb_lsstcomcamsim", | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"exposure", | ||
"vignette_min", | ||
existing_type=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
type_=sa.INTEGER(), | ||
comment="Minimum value of vignette during the exposure.", | ||
existing_comment="Lowest amount of instrument vignetting detected during the exposure: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_nullable=True, | ||
schema="cdb_lsstcomcamsim", | ||
) | ||
op.alter_column( | ||
"exposure", | ||
"vignette", | ||
existing_type=sa.VARCHAR(length=10) | ||
.with_variant(mysql.VARCHAR(length=10), "mysql") | ||
.with_variant(oracle.VARCHAR2(length=10), "oracle") | ||
.with_variant(sa.VARCHAR(length=10), "postgresql"), | ||
type_=sa.INTEGER(), | ||
comment="Instrument blocked from the sky: Unknown = 0, No = 1, Partially = 2, Fully = 3.", | ||
existing_comment="Instrument blocked from the sky: UNKNOWN, NO, PARTIALLY, FULLY.", | ||
existing_nullable=True, | ||
schema="cdb_lsstcomcamsim", | ||
) | ||
# ### end Alembic commands ### |