Skip to content

Commit

Permalink
Merge branch 'main' into 378-update-submission-processing-to-use-pola…
Browse files Browse the repository at this point in the history
…rs-data-validator
  • Loading branch information
jcadam14 committed Nov 7, 2024
2 parents dba40ec + 71d24a3 commit 39496e9
Show file tree
Hide file tree
Showing 19 changed files with 1,783 additions and 1,064 deletions.
28 changes: 28 additions & 0 deletions db_revisions/versions/26f11ac15b3c_add_is_voluntary_to_filing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""add is_voluntary to filing
Revision ID: 26f11ac15b3c
Revises: f4091e4ce218
Create Date: 2024-10-16 15:15:41.261646
"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "26f11ac15b3c"
down_revision: Union[str, None] = "f4091e4ce218"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
with op.batch_alter_table("filing") as batch_op:
batch_op.add_column(sa.Column("is_voluntary", sa.Boolean, server_default=sa.text("false"), nullable=False))


def downgrade() -> None:
op.drop_column("filing", "is_voluntary")
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""change is_voluntary to nullable
Revision ID: 63138f5cf036
Revises: 26f11ac15b3c
Create Date: 2024-10-28 14:22:58.391354
"""

from typing import Sequence, Union

from alembic import op


# revision identifiers, used by Alembic.
revision: str = "63138f5cf036"
down_revision: Union[str, None] = "26f11ac15b3c"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
with op.batch_alter_table("filing", schema=None) as batch_op:
batch_op.alter_column("is_voluntary", nullable=True)


def downgrade() -> None:
with op.batch_alter_table("filing", schema=None) as batch_op:
batch_op.alter_column("is_voluntary", nullable=False)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""Set character limit in contact info
Revision ID: 6babc6109a5a
Revises: ba8234fe9eb5
Create Date: 2024-10-07 16:33:18.213745
"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision: str = "6babc6109a5a"
down_revision: Union[str, None] = "ba8234fe9eb5"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
with op.batch_alter_table("contact_info", schema=None) as batch_op:
batch_op.alter_column("first_name", type_=sa.String(255), nullable=False)
batch_op.alter_column("last_name", type_=sa.String(255), nullable=False)
batch_op.alter_column("hq_address_street_1", type_=sa.String(255), nullable=False)
batch_op.alter_column("hq_address_street_2", type_=sa.String(255), nullable=True)
batch_op.alter_column("hq_address_street_3", type_=sa.String(255), nullable=True)
batch_op.alter_column("hq_address_street_4", type_=sa.String(255), nullable=True)
batch_op.alter_column("hq_address_city", type_=sa.String(255), nullable=False)
batch_op.alter_column("hq_address_state", type_=sa.String(255), nullable=False)
batch_op.alter_column("email", type_=sa.String(255), nullable=False)
batch_op.alter_column("phone_number", type_=sa.String(255), nullable=False)
batch_op.alter_column("phone_ext", type_=sa.String(255), nullable=True)


def downgrade() -> None:
with op.batch_alter_table("contact_info", schema=None) as batch_op:
batch_op.alter_column("first_name", type_=sa.String, nullable=False)
batch_op.alter_column("last_name", type_=sa.String, nullable=False)
batch_op.alter_column("hq_address_street_1", type_=sa.String, nullable=False)
batch_op.alter_column("hq_address_street_2", type_=sa.String, nullable=True)
batch_op.alter_column("hq_address_street_3", type_=sa.String, nullable=True)
batch_op.alter_column("hq_address_street_4", type_=sa.String, nullable=True)
batch_op.alter_column("hq_address_city", type_=sa.String, nullable=False)
batch_op.alter_column("hq_address_state", type_=sa.String, nullable=False)
batch_op.alter_column("email", type_=sa.String, nullable=False)
batch_op.alter_column("phone_number", type_=sa.String, nullable=False)
batch_op.alter_column("phone_ext", type_=sa.String, nullable=True)
29 changes: 29 additions & 0 deletions db_revisions/versions/ba8234fe9eb5_add_extension_to_contactinfo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""add extension to contactinfo
Revision ID: ba8234fe9eb5
Revises: 7356a7d7036d
Create Date: 2024-09-24 12:26:46.755693
"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "ba8234fe9eb5"
down_revision: Union[str, None] = "7356a7d7036d"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
with op.batch_alter_table("contact_info") as batch_op:
batch_op.add_column(sa.Column("phone_ext", sa.String(254), nullable=True))


def downgrade() -> None:
with op.batch_alter_table("contact_info") as batch_op:
batch_op.drop_column("phone_ext")
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"""Add character limit to user_action columns
Revision ID: f4091e4ce218
Revises: 6babc6109a5a
Create Date: 2024-10-08 01:33:25.832473
"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "f4091e4ce218"
down_revision: Union[str, None] = "6babc6109a5a"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:

with op.batch_alter_table("user_action", schema=None) as batch_op:
batch_op.alter_column(
"user_name",
type_=sa.String(length=255),
existing_type=sa.String,
nullable=False,
)
batch_op.alter_column(
"user_email",
type_=sa.String(length=255),
nullable=False,
)
batch_op.alter_column(
"user_id",
type_=sa.String(length=36),
existing_type=sa.String,
nullable=False,
)


def downgrade() -> None:
with op.batch_alter_table("user_action", schema=None) as batch_op:
batch_op.alter_column(
"user_name",
type_=sa.String,
existing_type=sa.String(length=255),
nullable=False,
)
batch_op.alter_column(
"user_email",
type_=sa.String,
existing_type=sa.String(length=255),
nullable=False,
)
batch_op.alter_column(
"user_id",
type_=sa.String,
existing_type=sa.String(length=36),
nullable=False,
)
Loading

0 comments on commit 39496e9

Please sign in to comment.