From 26cdb921e6b0a8fab1c83bd08ed29d3247cfa260 Mon Sep 17 00:00:00 2001 From: Valerie Becker Date: Fri, 18 Oct 2024 13:28:37 -0700 Subject: [PATCH] Change nullable values for adding columns in three dbs --- ...5663e_change_primary_key_to_day_obs_seq_num.py | 15 ++++++++------- ...1cc12_change_primary_key_to_day_obs_seq_num.py | 15 ++++++++------- ...c44fc_change_primary_key_to_day_obs_seq_num.py | 15 ++++++++------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/alembic/latiss/versions/53707815663e_change_primary_key_to_day_obs_seq_num.py b/alembic/latiss/versions/53707815663e_change_primary_key_to_day_obs_seq_num.py index 3baa252c..03d83076 100644 --- a/alembic/latiss/versions/53707815663e_change_primary_key_to_day_obs_seq_num.py +++ b/alembic/latiss/versions/53707815663e_change_primary_key_to_day_obs_seq_num.py @@ -8,10 +8,11 @@ from typing import Sequence, Union -from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql +from alembic import op + # revision identifiers, used by Alembic. revision: str = "53707815663e" down_revision: Union[str, None] = "59776480aa4d" @@ -30,7 +31,7 @@ def upgrade() -> None: sa.Column( "day_obs", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Day of observation.", ), schema="cdb_latiss", @@ -40,7 +41,7 @@ def upgrade() -> None: sa.Column( "seq_num", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Sequence number.", ), schema="cdb_latiss", @@ -63,7 +64,7 @@ def upgrade() -> None: sa.Column( "day_obs", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Day of observation.", ), schema="cdb_latiss", @@ -73,7 +74,7 @@ def upgrade() -> None: sa.Column( "seq_num", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Sequence number.", ), schema="cdb_latiss", @@ -92,7 +93,7 @@ def upgrade() -> None: sa.Column( "day_obs", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Day of observation.", ), schema="cdb_latiss", @@ -102,7 +103,7 @@ def upgrade() -> None: sa.Column( "seq_num", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Sequence number.", ), schema="cdb_latiss", diff --git a/alembic/lsstcomcam/versions/bf7ed261cc12_change_primary_key_to_day_obs_seq_num.py b/alembic/lsstcomcam/versions/bf7ed261cc12_change_primary_key_to_day_obs_seq_num.py index 01f73627..28b9236d 100644 --- a/alembic/lsstcomcam/versions/bf7ed261cc12_change_primary_key_to_day_obs_seq_num.py +++ b/alembic/lsstcomcam/versions/bf7ed261cc12_change_primary_key_to_day_obs_seq_num.py @@ -8,10 +8,11 @@ from typing import Sequence, Union -from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql +from alembic import op + # revision identifiers, used by Alembic. revision: str = "bf7ed261cc12" down_revision: Union[str, None] = "d54a539aad4d" @@ -33,7 +34,7 @@ def upgrade() -> None: sa.Column( "day_obs", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Day of observation.", ), schema="cdb_lsstcomcam", @@ -43,7 +44,7 @@ def upgrade() -> None: sa.Column( "seq_num", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Sequence number.", ), schema="cdb_lsstcomcam", @@ -75,7 +76,7 @@ def upgrade() -> None: sa.Column( "day_obs", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Day of observation.", ), schema="cdb_lsstcomcam", @@ -85,7 +86,7 @@ def upgrade() -> None: sa.Column( "seq_num", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Sequence number.", ), schema="cdb_lsstcomcam", @@ -104,7 +105,7 @@ def upgrade() -> None: sa.Column( "day_obs", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Day of observation.", ), schema="cdb_lsstcomcam", @@ -114,7 +115,7 @@ def upgrade() -> None: sa.Column( "seq_num", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Sequence number.", ), schema="cdb_lsstcomcam", diff --git a/alembic/lsstcomcamsim/versions/5f50b32c44fc_change_primary_key_to_day_obs_seq_num.py b/alembic/lsstcomcamsim/versions/5f50b32c44fc_change_primary_key_to_day_obs_seq_num.py index 175e8322..f23839e6 100644 --- a/alembic/lsstcomcamsim/versions/5f50b32c44fc_change_primary_key_to_day_obs_seq_num.py +++ b/alembic/lsstcomcamsim/versions/5f50b32c44fc_change_primary_key_to_day_obs_seq_num.py @@ -8,10 +8,11 @@ from typing import Sequence, Union -from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql +from alembic import op + # revision identifiers, used by Alembic. revision: str = "5f50b32c44fc" down_revision: Union[str, None] = "3f8460378c1e" @@ -26,7 +27,7 @@ def upgrade() -> None: sa.Column( "day_obs", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Day of observation.", ), schema="cdb_lsstcomcamsim", @@ -36,7 +37,7 @@ def upgrade() -> None: sa.Column( "seq_num", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Sequence number.", ), schema="cdb_lsstcomcamsim", @@ -75,7 +76,7 @@ def upgrade() -> None: sa.Column( "day_obs", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Day of observation.", ), schema="cdb_lsstcomcamsim", @@ -85,7 +86,7 @@ def upgrade() -> None: sa.Column( "seq_num", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Sequence number.", ), schema="cdb_lsstcomcamsim", @@ -104,7 +105,7 @@ def upgrade() -> None: sa.Column( "day_obs", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Day of observation.", ), schema="cdb_lsstcomcamsim", @@ -114,7 +115,7 @@ def upgrade() -> None: sa.Column( "seq_num", sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, + nullable=True, comment="Sequence number.", ), schema="cdb_lsstcomcamsim",