Skip to content

Commit

Permalink
Add migrations to fix ccdvisit views.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktlim committed Dec 5, 2024
1 parent 593b437 commit 685c169
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Fix visit_id in ccdvisit views.
Revision ID: adbbeceff286
Revises: 47c0b5ce839e
Create Date: 2024-12-05 00:56:52.135839+00:00
"""

from typing import Sequence, Union

from alembic import op


# revision identifiers, used by Alembic.
revision: str = "adbbeceff286"
down_revision: Union[str, None] = "47c0b5ce839e"
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.execute("ALTER TABLE cdb_latiss.ccdvisit1 RENAME COLUMN exposure_id TO visit_id")
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.execute("ALTER TABLE cdb_latiss.ccdvisit1 RENAME COLUMN visit_id TO iexposure_id")
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Fix visit_id in ccdvisit views.
Revision ID: 913d10c6ed81
Revises: 12f0d22a2347
Create Date: 2024-12-05 00:56:53.875464+00:00
"""

from typing import Sequence, Union

from alembic import op


# revision identifiers, used by Alembic.
revision: str = "913d10c6ed81"
down_revision: Union[str, None] = "12f0d22a2347"
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.execute("ALTER TABLE cdb_latiss.ccdvisit1 RENAME COLUMN exposure_id TO visit_id")
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.execute("ALTER TABLE cdb_latiss.ccdvisit1 RENAME COLUMN visit_id TO iexposure_id")
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Fix visit_id in ccdvisit views.
Revision ID: ab45b3673c90
Revises: cb09b95e12fb
Create Date: 2024-12-05 00:56:55.551902+00:00
"""

from typing import Sequence, Union

from alembic import op


# revision identifiers, used by Alembic.
revision: str = "ab45b3673c90"
down_revision: Union[str, None] = "cb09b95e12fb"
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.execute("ALTER TABLE cdb_latiss.ccdvisit1 RENAME COLUMN exposure_id TO visit_id")
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.execute("ALTER TABLE cdb_latiss.ccdvisit1 RENAME COLUMN visit_id TO iexposure_id")
# ### end Alembic commands ###

0 comments on commit 685c169

Please sign in to comment.