<commit_before>"""Create scep_config table

Revision ID: f5237c7e2374
Revises: <KEY>
Create Date: 2017-05-19 19:34:00.120370

"""
from alembic import op, context
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'f5237c7e2374'
down_revision = '<KEY>'
branch_labels = None
depends_on = None

TABLE = ('scep_config',
         sa.Column('id', sa.Integer(), nullable=False, autoincrement=True),
         sa.Column('url', sa.String(), nullable=False),
         sa.Column('challenge_enabled', sa.Boolean(), nullable=True),
         sa.Column('challenge', sa.String(), nullable=True),
         sa.Column('ca_fingerprint', sa.String(), nullable=True),
         sa.Column('subject', sa.String(), nullable=False),
         sa.Column('key_size', sa.Integer(), nullable=False),
         sa.Column('key_type', sa.String(), nullable=False),
         sa.Column('key_usage', sa.Enum('Signing', 'Encryption', 'All', name='keyusage'), nullable=True),
         sa.Column('retries', sa.Integer(), nullable=False),
         sa.Column('retry_delay', sa.Integer(), nullable=False),
         sa.Column('certificate_renewal_time_interval', sa.Integer(), nullable=False),
         sa.PrimaryKeyConstraint('id')
         )

DEMO_SCEP_CONFIG = {
    'url': 'http://localhost:5000',
    'challenge_enabled': True,
    'challenge': 'sekret',
    'subject': 'CN=%HardwareUUID%',
    'key_size': 2048,
    'key_usage': 'All',
    'retries': 3,
    'retry_delay': 10,
    'certificate_renewal_time_interval': 24
}


def upgrade():
    schema_upgrades()
    if context.get_x_argument(as_dictionary=True).get('data', None):
        data_upgrades()


def downgrade():
    if context.get_x_argument(as_dictionary=True).get('data', None):
        data_downgrades()
    schema_downgrades()

<commit_msg>was missing key_type in scep_config defaults<commit_after>"""Create scep_config table

Revision ID: f5237c7e2374
Revises: e5<PASSWORD>1<PASSWORD>
Create Date: 2017-05-19 19:34:00.120370

"""
from alembic import op, context
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'f5237c7e2374'
down_revision = '<KEY>'
branch_labels = None
depends_on = None

TABLE = ('scep_config',
         sa.Column('id', sa.Integer(), nullable=False, autoincrement=True),
         sa.Column('url', sa.String(), nullable=False),
         sa.Column('challenge_enabled', sa.Boolean(), nullable=True),
         sa.Column('challenge', sa.String(), nullable=True),
         sa.Column('ca_fingerprint', sa.String(), nullable=True),
         sa.Column('subject', sa.String(), nullable=False),
         sa.Column('key_size', sa.Integer(), nullable=False),
         sa.Column('key_type', sa.String(), nullable=False, server_default='RSA'),
         sa.Column('key_usage', sa.Enum('Signing', 'Encryption', 'All', name='keyusage'), nullable=True),
         sa.Column('retries', sa.Integer(), nullable=False),
         sa.Column('retry_delay', sa.Integer(), nullable=False),
         sa.Column('certificate_renewal_time_interval', sa.Integer(), nullable=False),
         sa.PrimaryKeyConstraint('id')
         )

DEMO_SCEP_CONFIG = {
    'url': 'http://localhost:5000',
    'challenge_enabled': True,
    'challenge': 'sekret',
    'subject': 'CN=%HardwareUUID%',
    'key_size': 2048,
    'key_type': 'RSA',
    'key_usage': 'All',
    'retries': 3,
    'retry_delay': 10,
    'certificate_renewal_time_interval': 24
}


def upgrade():
    schema_upgrades()
    if context.get_x_argument(as_dictionary=True).get('data', None):
        data_upgrades()


def downgrade():
    if context.get_x_argument(as_dictionary=True).get('data', None):
        data_downgrades()
    schema_downgrades()


{'fraction_non_alphanumeric': 0.16158868335146898, 'fraction_numerical': 0.028291621327529923, 'mean_word_length': 4.01637107776262, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5034766', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1205, 'n_words': 228}