This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/data/migrations/versions/41f4587c84ae_add_jwt_authentication_login_service.py
Silas Sewell 30b0101584 Fix seq generators for enum tables in postgres
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
2015-11-16 15:29:51 -05:00

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')))
)