43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""+invoice table
|
|
|
|
Revision ID: e237f7c5cb9a
|
|
Revises: bb542353b092
|
|
Create Date: 2026-07-31 11:45:00.530489
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'e237f7c5cb9a'
|
|
down_revision: Union[str, Sequence[str], None] = 'bb542353b092'
|
|
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('invoices',
|
|
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
|
sa.Column('creator_id', sa.BIGINT(), nullable=False),
|
|
sa.Column('amount', sa.FLOAT(), nullable=False),
|
|
sa.Column('status', sa.Enum('EXPIRED', 'ACTIVE', 'PAID', name='invoicestatus'), nullable=False),
|
|
sa.ForeignKeyConstraint(['creator_id'], ['users.id'], ),
|
|
sa.PrimaryKeyConstraint('id'),
|
|
sa.UniqueConstraint('id')
|
|
)
|
|
op.create_unique_constraint(None, 'addons', ['id'])
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint(None, 'addons', type_='unique')
|
|
op.drop_table('invoices')
|
|
# ### end Alembic commands ###
|