Skip to content

Commit

Permalink
Add docs_url to company
Browse files Browse the repository at this point in the history
  • Loading branch information
shrir committed Nov 11, 2024
1 parent 66fb3cb commit 09f5cee
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# type: ignore
"""Add docs_url column to company
Revision ID: 1183d2e97141
Revises: 419a1414c261
Create Date: 2024-11-11 12:32:20.264276+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 = '1183d2e97141'
down_revision = '419a1414c261'
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('company', schema=None) as batch_op:
batch_op.add_column(sa.Column('docs_url', sa.String(length=2083), 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('company', schema=None) as batch_op:
batch_op.drop_column('docs_url')

# ### 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!"""
1 change: 1 addition & 0 deletions src/app/domain/companies/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Company(CamelizedBaseStruct):
org_size: OrgSize | None = None
ios_app_url: str | None = None
android_app_url: str | None = None
docs_url: str | None = None
ios_app_details: AppDetails | None = None
android_app_details: AppDetails | None = None

Expand Down

0 comments on commit 09f5cee

Please sign in to comment.