Skip to content

Commit

Permalink
Alembic revisions to merge heads and to prevent failure due to non-un…
Browse files Browse the repository at this point in the history
…ique article values in oddpub_metrics table. Added podman-compose package to dev for Josh's local testing.
  • Loading branch information
joshlawrimore committed Jan 30, 2025
1 parent e2fcd1b commit 972a22c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
26 changes: 26 additions & 0 deletions alembic/versions/b751c4aa2a6e_merge_heads.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""merge heads
Revision ID: b751c4aa2a6e
Revises: 0b2196c1c66b, 600039d1785e
Create Date: 2025-01-30 08:59:15.317385
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'b751c4aa2a6e'
down_revision: Union[str, None] = ('0b2196c1c66b', '600039d1785e')
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
pass


def downgrade() -> None:
pass
33 changes: 33 additions & 0 deletions alembic/versions/ea94fafc9590_removing_unique_requirement_from_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Removing unique requirement from article column in oddpub_metrics table
Revision ID: ea94fafc9590
Revises: b751c4aa2a6e
Create Date: 2025-01-30 09:01:04.492792
"""

from typing import Sequence, Union

from alembic import op

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


def upgrade() -> None:
op.drop_index(
op.f("ix_oddpub_metrics_article"), table_name="oddpub_metrics"
)


def downgrade() -> None:

op.create_index(
op.f("ix_oddpub_metrics_article"),
"oddpub_metrics",
["article"],
unique=True,
)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dev = [
"types-beautifulsoup4",
"types-psycopg2",
"types-tqdm",
"podman-compose>=1.3.0",
]
ci = [
"coverage>=7.6.7",
Expand Down

0 comments on commit 972a22c

Please sign in to comment.