Skip to content

Commit

Permalink
Add a migration for item hash table. See #452
Browse files Browse the repository at this point in the history
  • Loading branch information
breyten committed Jan 18, 2024
1 parent e3a588d commit eb6a45e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
volumes:
- oridata:/opt/ori/data
#- .:/opt/ori
- ./ocd_backend/sources:/opt/ori/ocd_backend/sources
- ./ocd_backend:/opt/ori/ocd_backend
depends_on:
elastic:
condition: service_healthy
Expand All @@ -35,7 +35,7 @@ services:
volumes:
- oridata:/opt/ori/data
#- .:/opt/ori
- ./ocd_backend/sources:/opt/ori/ocd_backend/sources
- ./ocd_backend:/opt/ori/ocd_backend
depends_on:
elastic:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Create item hash table.
Revision ID: 3dc654fde400
Revises: 5b2ac6d04808
Create Date: 2024-01-18 14:52:33.587403
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3dc654fde400'
down_revision = '5b2ac6d04808'
branch_labels = None
depends_on = None


def upgrade():
op.create_table('item_hash',
sa.Column('id', sa.BigInteger(), nullable=False),
sa.Column('item_id', sa.String(), nullable=False, index=True, unique=True),
sa.Column('item_hash', sa.String(), nullable=False),
sa.PrimaryKeyConstraint('id')
)


def downgrade():
op.drop_table('item_hash')

0 comments on commit eb6a45e

Please sign in to comment.