This attempts to insert a temporary entry into each enum table until it succeeds. It re-synchronizes the postgres sequence generators with the max id of the table. Fixes #883 and #880
28 lines
550 B
Python
28 lines
550 B
Python
"""Add JWT Authentication login service
|
|
|
|
Revision ID: 41f4587c84ae
|
|
Revises: 1f116e06b68
|
|
Create Date: 2015-06-02 16:13:02.636590
|
|
|
|
"""
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '41f4587c84ae'
|
|
down_revision = '1f116e06b68'
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
def upgrade(tables):
|
|
op.bulk_insert(tables.loginservice,
|
|
[
|
|
{'name':'jwtauthn'},
|
|
])
|
|
|
|
|
|
def downgrade(tables):
|
|
op.execute(
|
|
(tables.loginservice.delete()
|
|
.where(tables.loginservice.c.name == op.inline_literal('jwtauthn')))
|
|
)
|