"""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 ###