41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
"""passkey
|
|
|
|
Revision ID: b5448df204eb
|
|
Revises: a74320a5d7a1
|
|
Create Date: 2023-12-25 00:13:01.703575
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'b5448df204eb'
|
|
down_revision = 'a74320a5d7a1'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('passkey_credential',
|
|
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
|
sa.Column('user_id', sa.Uuid(), nullable=False),
|
|
sa.Column('credential_id', sa.BINARY(), nullable=False),
|
|
sa.Column('credential_public_key', sa.BINARY(), nullable=False),
|
|
sa.Column('name', sa.String(length=250), nullable=False),
|
|
sa.Column('last_used', sa.DateTime(), nullable=True),
|
|
sa.Column('sign_count', sa.Integer(), nullable=False),
|
|
sa.Column('created_at', sa.DateTime(), nullable=False),
|
|
sa.Column('modified_at', sa.DateTime(), nullable=False),
|
|
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ondelete='CASCADE'),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('passkey_credential')
|
|
# ### end Alembic commands ###
|