<commit_before>"""
Create place tables

Revision ID: 3cdfbb1dd1e
Revises: <PASSWORD>
Create Date: 2015-10-28 09:16:10.822474
"""

from alembic import op
import sqlalchemy as sa


revision = '3cdfbb1dd1e'
down_revision = '4<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table(
        'place',
        sa.Column('id', sa.Integer, primary_key=True, nullable=False),
        sa.Column('slug', sa.String, unique=True, nullable=False),
        sa.Column('name', sa.String, nullable=False),
        sa.Column('description', sa.String, nullable=False),
        sa.Column('creation_date', sa.DateTime, nullable=False),
        sa.Column('creator_id', sa.Integer, sa.ForeignKey('account.id'),
                  nullable=False),
    )

    op.create_table(
        'place_update',
        sa.Column('id', sa.Integer, primary_key=True, nullable=False),
        sa.Column('place_id', sa.Integer, sa.ForeignKey('place.id'),
                  nullable=False),
        sa.Column('account_id', sa.Integer, sa.ForeignKey('account.id'),
                  nullable=False),
        sa.Column('date', sa.DateTime, unique=True, nullable=False),
        sa.Column('used_spaces', sa.Integer, nullable=False),
        sa.Column('free_spaces', sa.Integer, nullable=False),
    )


def downgrade():
    op.drop_table('place_update')
    op.drop_table('place')<commit_msg>Update migrations<commit_after>"""
Create place tables

Revision ID: 3cdfbb1dd1e
Revises: <PASSWORD>
Create Date: 2015-10-28 09:16:10.822474
"""

from alembic import op
import sqlalchemy as sa


revision = '3cdfbb1dd1e'
down_revision = '47d36160f6e'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table(
        'author',
        sa.Column('id', sa.Integer, primary_key=True, nullable=False),
        sa.Column('account_id', sa.Integer, nullable=True),
        sa.Column('ip_address', sa.String, nullable=False),
        sa.Column('date', sa.DateTime, nullable=False),
    )

    op.create_table(
        'approval',
        sa.Column('id', sa.Integer, primary_key=True, nullable=False),
        sa.Column('account_id', sa.Integer, sa.ForeignKey('account.id'),
                  nullable=True),
        sa.Column('date', sa.DateTime, nullable=True),
    )

    op.create_table(
        'place',
        sa.Column('id', sa.Integer, primary_key=True, nullable=False),
        sa.Column('slug', sa.String, unique=True, nullable=False),
        sa.Column('name', sa.String, nullable=False),
        sa.Column('description', sa.String, nullable=False),
        sa.Column('location', sa.String, nullable=False),
        sa.Column('author_id', sa.Integer, sa.ForeignKey('author.id'),
                  nullable=False),
        sa.Column('approval_id', sa.Integer, sa.ForeignKey('approval.id'),
                  nullable=True),
    )

    op.create_table(
        'place_change',
        sa.Column('id', sa.Integer, primary_key=True, nullable=False),
        sa.Column('place_id', sa.Integer, sa.ForeignKey('place.id'),
                  nullable=False),
        sa.Column('author_id', sa.Integer, sa.ForeignKey('author.id'),
                  nullable=False),
        sa.Column('column', sa.String, nullable=False),
        sa.Column('old_value', sa.String, nullable=False),
        sa.Column('new_value', sa.String, nullable=False),
        sa.Column('approval_id', sa.Integer, sa.ForeignKey('approval.id'),
                  nullable=True),
    )

    op.create_table(
        'place_update',
        sa.Column('id', sa.Integer, primary_key=True, nullable=False),
        sa.Column('place_id', sa.Integer, sa.ForeignKey('place.id'),
                  nullable=False),
        sa.Column('author_id', sa.Integer, sa.ForeignKey('author.id'),
                  nullable=False),
        sa.Column('date', sa.DateTime, unique=True, nullable=False),
        sa.Column('used_spaces', sa.Integer, nullable=False),
        sa.Column('free_spaces', sa.Integer, nullable=False),
        sa.Column('approval_id', sa.Integer, sa.ForeignKey('approval.id'),
                  nullable=True),
    )


def downgrade():
    op.drop_table('place_update')
    op.drop_table('place')
    op.drop_table('author')
{'fraction_non_alphanumeric': 0.1530929066157153, 'fraction_numerical': 0.014568903749701457, 'mean_word_length': 2.965909090909091, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '2491607', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1339, 'n_words': 228}