2021-05-07 16:08:34 +01:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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():
|
|
|
|
|
op.create_table(
|
|
|
|
|
'webauthn_credential',
|
2021-05-10 16:36:00 +01:00
|
|
|
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
|
2021-05-07 16:08:34 +01:00
|
|
|
sa.Column('user_id', postgresql.UUID(as_uuid=True), nullable=False),
|
2021-05-10 16:36:00 +01:00
|
|
|
sa.Column('name', sa.String(), nullable=False),
|
|
|
|
|
|
|
|
|
|
sa.Column('credential_data', sa.String(), nullable=False),
|
|
|
|
|
sa.Column('registration_response', sa.String(), nullable=False),
|
|
|
|
|
|
2021-05-07 16:08:34 +01:00
|
|
|
sa.Column('created_at', sa.DateTime(), nullable=False),
|
|
|
|
|
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
2021-05-10 16:36:00 +01:00
|
|
|
|
2021-05-07 16:08:34 +01:00
|
|
|
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
2021-05-10 16:36:00 +01:00
|
|
|
sa.PrimaryKeyConstraint('id')
|
2021-05-07 16:08:34 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
|
op.drop_table('webauthn_credential')
|