<commit_before>"""create periodictask, periodictaskoption, periodictasklastrun tables

Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2018-06-20 09:55:52.086626

"""

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>8d4f3<PASSWORD>'

from alembic import op
import sqlalchemy as sa


def upgrade():
    try:
        op.create_table('periodictask',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('name', sa.Unicode(length=64), nullable=False),
        sa.Column('active', sa.Boolean(), nullable=False),
        sa.Column('interval', sa.Unicode(length=256), nullable=False),
        sa.Column('nodes', sa.Unicode(length=256), nullable=False),
        sa.Column('taskmodule', sa.Unicode(length=256), nullable=False),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('name')
        )
        op.create_table('periodictasklastrun',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('periodictask_id', sa.Integer(), nullable=True),
        sa.Column('node', sa.Unicode(length=256), nullable=False),
        sa.Column('timestamp', sa.DateTime(), nullable=False),
        sa.ForeignKeyConstraint(['periodictask_id'], ['periodictask.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('periodictask_id', 'node', name='ptlrix_1')
        )
        op.create_table('periodictaskoption',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('periodictask_id', sa.Integer(), nullable=True),
        sa.Column('key', sa.Unicode(length=256), nullable=False),
        sa.Column('value', sa.Unicode(length=2000), nullable=True),
        sa.ForeignKeyConstraint(['periodictask_id'], ['periodictask.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('periodictask_id', 'key', name='ptoix_1')
        )
    except Exception, exx:
        print "Could not add tables for periodic tasks!"
        print exx


def downgrade():
    op.drop_table('periodictaskoption')
    op.drop_table('periodictasklastrun')
    op.drop_table('periodictask')<commit_msg>Add MySQL row format to periodic task tables<commit_after>"""create periodictask, periodictaskoption, periodictasklastrun tables

Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2018-06-20 09:55:52.086626

"""

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'

from alembic import op
import sqlalchemy as sa


def upgrade():
    try:
        op.create_table('periodictask',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('name', sa.Unicode(length=64), nullable=False),
        sa.Column('active', sa.Boolean(), nullable=False),
        sa.Column('interval', sa.Unicode(length=256), nullable=False),
        sa.Column('nodes', sa.Unicode(length=256), nullable=False),
        sa.Column('taskmodule', sa.Unicode(length=256), nullable=False),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('name'),
        mysql_row_format='DYNAMIC'
        )
        op.create_table('periodictasklastrun',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('periodictask_id', sa.Integer(), nullable=True),
        sa.Column('node', sa.Unicode(length=256), nullable=False),
        sa.Column('timestamp', sa.DateTime(), nullable=False),
        sa.ForeignKeyConstraint(['periodictask_id'], ['periodictask.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('periodictask_id', 'node', name='ptlrix_1'),
        mysql_row_format='DYNAMIC'
        )
        op.create_table('periodictaskoption',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('periodictask_id', sa.Integer(), nullable=True),
        sa.Column('key', sa.Unicode(length=256), nullable=False),
        sa.Column('value', sa.Unicode(length=2000), nullable=True),
        sa.ForeignKeyConstraint(['periodictask_id'], ['periodictask.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('periodictask_id', 'key', name='ptoix_1'),
        mysql_row_format='DYNAMIC'
        )
    except Exception, exx:
        print "Could not add tables for periodic tasks!"
        print exx


def downgrade():
    op.drop_table('periodictaskoption')
    op.drop_table('periodictasklastrun')
    op.drop_table('periodictask')
{'fraction_non_alphanumeric': 0.1566098572086596, 'fraction_numerical': 0.020497466605251036, 'mean_word_length': 3.7988950276243094, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '231913', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1342, 'n_words': 231}