Support-BOT

This commit is contained in:
2024-05-01 19:55:22 +03:00
commit 4280385d32
34 changed files with 1361 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
"""first commit
Revision ID: 559d3cc36e6e
Revises:
Create Date: 2023-04-10 13:09:57.880742
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '559d3cc36e6e'
down_revision = None
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('user',
sa.Column('telegram_id', sa.BigInteger(), nullable=False),
sa.Column('telegram_username', sa.String(length=100), nullable=True),
sa.Column('is_banned', sa.Boolean(), nullable=True),
sa.Column('first_name', sa.String(length=100), nullable=True),
sa.Column('last_name', sa.String(length=100), nullable=True),
sa.Column('is_admin', sa.Boolean(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False),
sa.Column('updated_at', sa.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('telegram_id')
)
op.create_table('message',
sa.Column('telegram_user_id', sa.Integer(), nullable=False),
sa.Column('answer_to_user_id', sa.Integer(), nullable=True),
sa.Column('text', sa.Text(), nullable=True),
sa.Column('attachments', sa.Boolean(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False),
sa.Column('updated_at', sa.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False),
sa.ForeignKeyConstraint(['answer_to_user_id'], ['user.telegram_id'], ),
sa.ForeignKeyConstraint(['telegram_user_id'], ['user.telegram_id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('message')
op.drop_table('user')
# ### end Alembic commands ###