<commit_before>"""Added event-level image storage

Revision ID: 2fd1bc34a83c
Revises: 365fe2261342
Create Date: 2015-08-13 10:58:25.469907
"""

import sqlalchemy as sa
from alembic import op
from indico.core.db.sqlalchemy import UTCDateTime


# revision identifiers, used by Alembic.
revision = '2fd1bc34a83c'
down_revision = '365fe2261342'


def upgrade():
    op.create_table('image_files',
                    sa.Column('created_dt', UTCDateTime, nullable=False),
                    sa.Column('filename', sa.String(), nullable=False),
                    sa.Column('content_type', sa.String(), nullable=False),
                    sa.Column('size', sa.BigInteger(), nullable=False),
                    sa.Column('storage_backend', sa.String(), nullable=False),
                    sa.Column('storage_file_id', sa.String(), nullable=False),
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('event_id', sa.Integer(), index=True, nullable=False),
                    sa.ForeignKeyConstraint(['event_id'], [u'events.events.id']),
                    sa.PrimaryKeyConstraint('id'),
                    schema='events')
    op.create_table('legacy_image_id_map',
                    sa.Column('event_id', sa.Integer(), nullable=False, index=True),
                    sa.Column('legacy_image_id', sa.Integer(), nullable=False, index=True),
                    sa.Column('image_id', sa.Integer(), nullable=False),
                    sa.ForeignKeyConstraint(['event_id'], [u'events.events.id']),
                    sa.ForeignKeyConstraint(['image_id'], [u'events.image_files.id']),
                    sa.PrimaryKeyConstraint('event_id', 'legacy_image_id'),
                    schema='events')


def downgrade():<commit_msg>Fix alembic revision ids<commit_after>"""Added event-level image storage

Revision ID: 2fd1bc34a83c
Revises: b<PASSWORD>1
Create Date: 2015-08-13 10:58:25.469907
"""

import sqlalchemy as sa
from alembic import op
from indico.core.db.sqlalchemy import UTCDateTime


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


def upgrade():
    op.create_table('image_files',
                    sa.Column('created_dt', UTCDateTime, nullable=False),
                    sa.Column('filename', sa.String(), nullable=False),
                    sa.Column('content_type', sa.String(), nullable=False),
                    sa.Column('size', sa.BigInteger(), nullable=False),
                    sa.Column('storage_backend', sa.String(), nullable=False),
                    sa.Column('storage_file_id', sa.String(), nullable=False),
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('event_id', sa.Integer(), index=True, nullable=False),
                    sa.ForeignKeyConstraint(['event_id'], [u'events.events.id']),
                    sa.PrimaryKeyConstraint('id'),
                    schema='events')
    op.create_table('legacy_image_id_map',
                    sa.Column('event_id', sa.Integer(), nullable=False, index=True),
                    sa.Column('legacy_image_id', sa.Integer(), nullable=False, index=True),
                    sa.Column('image_id', sa.Integer(), nullable=False),
                    sa.ForeignKeyConstraint(['event_id'], [u'events.events.id']),
                    sa.ForeignKeyConstraint(['image_id'], [u'events.image_files.id']),
                    sa.PrimaryKeyConstraint('event_id', 'legacy_image_id'),
                    schema='events')


def downgrade():
{'fraction_non_alphanumeric': 0.1414881623449831, 'fraction_numerical': 0.023957158962795943, 'mean_word_length': 2.4794117647058824, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4640425', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1002, 'n_words': 176}