<commit_before>"""Added PageBanner mapped class.

Revision ID: 2c0bfc379e01
Revises: 2637e08f3c15
Create Date: 2012-04-02 14:24:16.271417

"""

# downgrade revision identifier, used by Alembic.
revision = '2c0bfc379e01'
down_revision = '2637e08f3c15'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    # create instance_groups table
    op.create_table(u'_pagebanner_secondary_tmp',
                    sa.Column('files_id',
                              sa.Integer,
                              sa.ForeignKey('files.id',
                                            onupdate='cascade',
                                            ondelete='cascade'),
                              primary_key=True),
                    sa.Column('nodes_id',
                              sa.Integer,
                              sa.ForeignKey('nodes.id',
                                            onupdate='cascade',
                                            ondelete='cascade'),
                              primary_key=True),
                    sa.Column(u'weight',
                              sa.Integer,
                              default=0),
                    mysql_engine=u'InnoDB')
    # populate instances_groups
    connection = op.get_bind()
    connection.execute(
        'INSERT INTO _pagebanner_secondary_tmp (nodes_id, files_id) '
        'SELECT nodes_id, files_id '
        'FROM nodes_banners__files'
    )
    op.drop_table(u'nodes_banners__files')
    op.rename_table(u'_pagebanner_secondary_tmp', u'nodes_banners__files')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(u'_pagebanner_secondary_tmp',
                    sa.Column('files_id',
                              sa.Integer,
                              sa.ForeignKey('files.id',
                                            onupdate='cascade',
                                            ondelete='cascade')),
                    sa.Column('nodes_id',
                              sa.Integer,
                              sa.ForeignKey('nodes.id',
                                            onupdate='cascade',
                                            ondelete='cascade')),
                    mysql_engine=u'InnoDB')
    # populate instances_groups
    connection = op.get_bind()
    connection.execute(
        'INSERT INTO _pagebanner_secondary_tmp (nodes_id, files_id) '
        'SELECT nodes_id, files_id '
        'FROM nodes_banners__files'
    )
    op.drop_table(u'nodes_banners__files')
    op.rename_table(u'_pagebanner_secondary_tmp', u'nodes_banners__files')
    ### end Alembic commands ###
<commit_msg>Fix alembic version order<commit_after>"""Added PageBanner mapped class.

Revision ID: <KEY>
Revises: 2<PASSWORD>
Create Date: 2012-04-02 14:24:16.271417

"""

# downgrade revision identifier, used by Alembic.
revision = '<KEY>'
down_revision = '18da<PASSWORD>'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    # create instance_groups table
    op.create_table(u'_pagebanner_secondary_tmp',
                    sa.Column('files_id',
                              sa.Integer,
                              sa.ForeignKey('files.id',
                                            onupdate='cascade',
                                            ondelete='cascade'),
                              primary_key=True),
                    sa.Column('nodes_id',
                              sa.Integer,
                              sa.ForeignKey('nodes.id',
                                            onupdate='cascade',
                                            ondelete='cascade'),
                              primary_key=True),
                    sa.Column(u'weight',
                              sa.Integer,
                              default=0),
                    mysql_engine=u'InnoDB')
    # populate instances_groups
    connection = op.get_bind()
    connection.execute(
        'INSERT INTO _pagebanner_secondary_tmp (nodes_id, files_id) '
        'SELECT nodes_id, files_id '
        'FROM nodes_banners__files'
    )
    op.drop_table(u'nodes_banners__files')
    op.rename_table(u'_pagebanner_secondary_tmp', u'nodes_banners__files')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(u'_pagebanner_secondary_tmp',
                    sa.Column('files_id',
                              sa.Integer,
                              sa.ForeignKey('files.id',
                                            onupdate='cascade',
                                            ondelete='cascade')),
                    sa.Column('nodes_id',
                              sa.Integer,
                              sa.ForeignKey('nodes.id',
                                            onupdate='cascade',
                                            ondelete='cascade')),
                    mysql_engine=u'InnoDB')
    # populate instances_groups
    connection = op.get_bind()
    connection.execute(
        'INSERT INTO _pagebanner_secondary_tmp (nodes_id, files_id) '
        'SELECT nodes_id, files_id '
        'FROM nodes_banners__files'
    )
    op.drop_table(u'nodes_banners__files')
    op.rename_table(u'_pagebanner_secondary_tmp', u'nodes_banners__files')
    ### end Alembic commands ###

{'fraction_non_alphanumeric': 0.090892696122633, 'fraction_numerical': 0.013886384129846708, 'mean_word_length': 1.3721129170230966, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3524802', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1393, 'n_words': 249}