-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract team name from job post and save it to job_post.team_name
- Loading branch information
Showing
5 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
src/app/db/migrations/versions/2024-12-11_add_team_name_to_job_post_7f74b429804b.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,71 @@ | ||
# type: ignore | ||
"""Add team_name to job_post | ||
Revision ID: 7f74b429804b | ||
Revises: 61c09de3ee8d | ||
Create Date: 2024-12-11 11:18:19.068433+00:00 | ||
""" | ||
from __future__ import annotations | ||
|
||
import warnings | ||
from typing import TYPE_CHECKING | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
from advanced_alchemy.types import EncryptedString, EncryptedText, GUID, ORA_JSONB, DateTimeUTC | ||
from sqlalchemy import Text # noqa: F401 | ||
|
||
if TYPE_CHECKING: | ||
from collections.abc import Sequence | ||
|
||
__all__ = ["downgrade", "upgrade", "schema_upgrades", "schema_downgrades", "data_upgrades", "data_downgrades"] | ||
|
||
sa.GUID = GUID | ||
sa.DateTimeUTC = DateTimeUTC | ||
sa.ORA_JSONB = ORA_JSONB | ||
sa.EncryptedString = EncryptedString | ||
sa.EncryptedText = EncryptedText | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '7f74b429804b' | ||
down_revision = '61c09de3ee8d' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
with warnings.catch_warnings(): | ||
warnings.filterwarnings("ignore", category=UserWarning) | ||
with op.get_context().autocommit_block(): | ||
schema_upgrades() | ||
data_upgrades() | ||
|
||
def downgrade() -> None: | ||
with warnings.catch_warnings(): | ||
warnings.filterwarnings("ignore", category=UserWarning) | ||
with op.get_context().autocommit_block(): | ||
data_downgrades() | ||
schema_downgrades() | ||
|
||
def schema_upgrades() -> None: | ||
"""schema upgrade migrations go here.""" | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('job_post', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('team_name', sa.String(), nullable=True)) | ||
|
||
# ### end Alembic commands ### | ||
|
||
def schema_downgrades() -> None: | ||
"""schema downgrade migrations go here.""" | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('job_post', schema=None) as batch_op: | ||
batch_op.drop_column('team_name') | ||
|
||
# ### end Alembic commands ### | ||
|
||
def data_upgrades() -> None: | ||
"""Add any optional data upgrade migrations here!""" | ||
|
||
def data_downgrades() -> None: | ||
"""Add any optional data downgrade migrations here!""" |
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
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
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
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