[+] add initial payloads/models.py migration

This commit is contained in:
Siarhei Siniak 2025-07-18 09:59:16 +03:00
parent fe33d5c7f6
commit d185aaf329
2 changed files with 41 additions and 1 deletions

@ -51,7 +51,7 @@ include-package-data = false
'online.fxreader.pr34.test_task_2025_07_17_v2' = 'python/online/fxreader/pr34/test_task_2025_07_17_v2' 'online.fxreader.pr34.test_task_2025_07_17_v2' = 'python/online/fxreader/pr34/test_task_2025_07_17_v2'
[tool.alembic] [tool.alembic]
script_location = 'python/online/fxreader/pr34/test_task_2025_07_17_v2/tickers/alembic' script_location = 'python/online/fxreader/pr34/test_task_2025_07_17_v2/payloads/alembic'
prepend_sys_path = ['python'] prepend_sys_path = ['python']
# sqlalchemy.url = 'asdfasdf:/asdfasdfa' # sqlalchemy.url = 'asdfasdf:/asdfasdfa'

@ -0,0 +1,40 @@
"""add payloads models
Revision ID: f7fa90d3339d
Revises:
Create Date: 2025-07-18 09:58:54.099010
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'f7fa90d3339d'
down_revision: Union[str, Sequence[str], None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('payloads_payload',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('output', sa.JSON(), nullable=False),
sa.Column('list_1', sa.JSON(), nullable=False),
sa.Column('list_2', sa.JSON(), nullable=False),
sa.Column('input_hash', sa.String(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('input_hash')
)
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('payloads_payload')
# ### end Alembic commands ###