Initial work allowing certificates to be revoked. (#941)
* Initial work allowing for certificates to be revoked.
This commit is contained in:
@ -3,6 +3,9 @@ from alembic import context
|
||||
from sqlalchemy import engine_from_config, pool
|
||||
from logging.config import fileConfig
|
||||
|
||||
import alembic_autogenerate_enums
|
||||
|
||||
|
||||
# this is the Alembic Config object, which provides
|
||||
# access to the values within the .ini file in use.
|
||||
config = context.config
|
||||
|
@ -14,28 +14,8 @@ from alembic import op
|
||||
|
||||
|
||||
def upgrade():
|
||||
connection = None
|
||||
|
||||
if not op.get_context().as_sql:
|
||||
connection = op.get_bind()
|
||||
connection.execution_options(isolation_level='AUTOCOMMIT')
|
||||
|
||||
op.execute("ALTER TYPE log_type ADD VALUE 'create_cert'")
|
||||
op.execute("ALTER TYPE log_type ADD VALUE 'update_cert'")
|
||||
|
||||
if connection is not None:
|
||||
connection.execution_options(isolation_level='READ_COMMITTED')
|
||||
op.sync_enum_values('public', 'log_type', ['key_view'], ['create_cert', 'key_view', 'update_cert'])
|
||||
|
||||
|
||||
def downgrade():
|
||||
connection = None
|
||||
|
||||
if not op.get_context().as_sql:
|
||||
connection = op.get_bind()
|
||||
connection.execution_options(isolation_level='AUTOCOMMIT')
|
||||
|
||||
op.execute("ALTER TYPE log_type DROP VALUE 'create_cert'")
|
||||
op.execute("ALTER TYPE log_type DROP VALUE 'update_cert'")
|
||||
|
||||
if connection is not None:
|
||||
connection.execution_options(isolation_level='READ_COMMITTED')
|
||||
op.sync_enum_values('public', 'log_type', ['create_cert', 'key_view', 'update_cert'], ['key_view'])
|
||||
|
28
lemur/migrations/versions/b29e2c4bf8c9_.py
Normal file
28
lemur/migrations/versions/b29e2c4bf8c9_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""Adds external ID checking and modifying enum
|
||||
|
||||
Revision ID: b29e2c4bf8c9
|
||||
Revises: 1ae8e3104db8
|
||||
Create Date: 2017-09-26 10:50:35.740367
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b29e2c4bf8c9'
|
||||
down_revision = '1ae8e3104db8'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('certificates', sa.Column('external_id', sa.String(128), nullable=True))
|
||||
op.sync_enum_values('public', 'log_type', ['create_cert', 'key_view', 'update_cert'], ['create_cert', 'key_view', 'revoke_cert', 'update_cert'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.sync_enum_values('public', 'log_type', ['create_cert', 'key_view', 'revoke_cert', 'update_cert'], ['create_cert', 'key_view', 'update_cert'])
|
||||
op.drop_column('certificates', 'external_id')
|
||||
# ### end Alembic commands ###
|
Reference in New Issue
Block a user