forked from kodorvan/stcs
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""Create User Conditional Setting
|
|
|
|
Revision ID: 70094ba27e80
|
|
Revises: 42c66cfe8d4e
|
|
Create Date: 2025-09-23 16:47:07.161544
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = '70094ba27e80'
|
|
down_revision: Union[str, Sequence[str], None] = '42c66cfe8d4e'
|
|
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('user_conditional_settings',
|
|
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
|
sa.Column('user_id', sa.Integer(), nullable=False),
|
|
sa.Column('limit_price', sa.Float(), nullable=False),
|
|
sa.Column('trigger_price', sa.Float(), nullable=False),
|
|
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
|
|
sa.PrimaryKeyConstraint('id'),
|
|
sa.UniqueConstraint('user_id')
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('user_conditional_settings')
|
|
# ### end Alembic commands ###
|