Files
notifications-api/migrations/versions/0355_add_webauthn_table.py

38 lines
1.3 KiB
Python
Raw Normal View History

"""
Revision ID: 0355_add_webauthn_table
Revises: 0354_government_channel
Create Date: 2021-05-07 17:04:22.017137
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0355_add_webauthn_table'
down_revision = '0354_government_channel'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
'webauthn_credential',
sa.Column('credential_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('aaguid', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('public_key', sa.String(), nullable=False),
sa.Column('user_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('registration_response', postgresql.JSONB(none_as_null=True, astext_type=sa.Text()), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('credential_id', 'user_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('webauthn_credential')
# ### end Alembic commands ###