"""add apikeys table

Revision ID: 25de3619cb35
Revises: 20f584dc80d2
Create Date: 2024-08-31 07:19:42.927401

"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes


# revision identifiers, used by Alembic.
revision = '25de3619cb35'
down_revision = '20f584dc80d2'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('apikey',
    sa.Column('description', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('hashed_key', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('short_key', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('team_id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
    sa.ForeignKeyConstraint(['team_id'], ['team.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('apikey')
    # ### end Alembic commands ###
