feat: integrated pally webhook (draft, needs rewrite)
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
"""user.id -> INTEGER, +user.referal_id
|
||||
|
||||
Revision ID: f1bb7c46f6f6
|
||||
Revises: c58e44d15cca
|
||||
Create Date: 2026-08-01 23:14:21.719693
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'f1bb7c46f6f6'
|
||||
down_revision: Union[str, Sequence[str], None] = 'c58e44d15cca'
|
||||
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.alter_column('invoices', 'creator_id',
|
||||
existing_type=sa.BIGINT(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('sessions', 'user_id',
|
||||
existing_type=sa.BIGINT(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
op.add_column('users', sa.Column('referal_id', sa.INTEGER(), nullable=True))
|
||||
op.alter_column('users', 'id',
|
||||
existing_type=sa.BIGINT(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False,
|
||||
autoincrement=True)
|
||||
op.alter_column('users', 'balance',
|
||||
existing_type=sa.REAL(),
|
||||
type_=sa.FLOAT(precision=2),
|
||||
existing_nullable=False)
|
||||
op.create_foreign_key(None, 'users', 'users', ['referal_id'], ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'users', type_='foreignkey')
|
||||
op.alter_column('users', 'balance',
|
||||
existing_type=sa.FLOAT(precision=2),
|
||||
type_=sa.REAL(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('users', 'id',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.BIGINT(),
|
||||
existing_nullable=False,
|
||||
autoincrement=True)
|
||||
op.drop_column('users', 'referal_id')
|
||||
op.alter_column('sessions', 'user_id',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.BIGINT(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('invoices', 'creator_id',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.BIGINT(),
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user