Spaces:
Sleeping
Sleeping
"""Remove_Transactions_From_Users | |
Revision ID: 8feaedca36f9 | |
Revises: cd515c44401d | |
Create Date: 2024-06-02 01:26:54.731002 | |
""" | |
from typing import Sequence, Union | |
from alembic import op | |
import sqlalchemy as sa | |
from sqlalchemy.dialects import postgresql | |
# revision identifiers, used by Alembic. | |
revision: str = '8feaedca36f9' | |
down_revision: Union[str, None] = 'cd515c44401d' | |
branch_labels: Union[str, Sequence[str], None] = None | |
depends_on: Union[str, Sequence[str], None] = None | |
def upgrade() -> None: | |
# ### commands auto generated by Alembic - please adjust! ### | |
op.alter_column('transactions', 'transaction_date', | |
existing_type=postgresql.TIMESTAMP(), | |
nullable=False) | |
op.alter_column('transactions', 'category', | |
existing_type=sa.VARCHAR(), | |
nullable=False) | |
op.alter_column('transactions', 'name_description', | |
existing_type=sa.VARCHAR(), | |
nullable=False) | |
op.alter_column('transactions', 'amount', | |
existing_type=sa.DOUBLE_PRECISION(precision=53), | |
nullable=False) | |
op.alter_column('transactions', 'type', | |
existing_type=sa.VARCHAR(), | |
nullable=False) | |
op.add_column('users', sa.Column('hashed_password', sa.String(), nullable=False)) | |
op.add_column('users', sa.Column('is_deleted', sa.Boolean(), nullable=False)) | |
op.alter_column('users', 'name', | |
existing_type=sa.VARCHAR(), | |
nullable=False) | |
op.alter_column('users', 'email', | |
existing_type=sa.VARCHAR(), | |
nullable=False) | |
# ### end Alembic commands ### | |
def downgrade() -> None: | |
# ### commands auto generated by Alembic - please adjust! ### | |
op.alter_column('users', 'email', | |
existing_type=sa.VARCHAR(), | |
nullable=True) | |
op.alter_column('users', 'name', | |
existing_type=sa.VARCHAR(), | |
nullable=True) | |
op.drop_column('users', 'is_deleted') | |
op.drop_column('users', 'hashed_password') | |
op.alter_column('transactions', 'type', | |
existing_type=sa.VARCHAR(), | |
nullable=True) | |
op.alter_column('transactions', 'amount', | |
existing_type=sa.DOUBLE_PRECISION(precision=53), | |
nullable=True) | |
op.alter_column('transactions', 'name_description', | |
existing_type=sa.VARCHAR(), | |
nullable=True) | |
op.alter_column('transactions', 'category', | |
existing_type=sa.VARCHAR(), | |
nullable=True) | |
op.alter_column('transactions', 'transaction_date', | |
existing_type=postgresql.TIMESTAMP(), | |
nullable=True) | |
# ### end Alembic commands ### | |