<commit_before>"""create_all_tables

Revision ID: 176f17297061
Revises: None
Create Date: 2014-04-09 09:15:25.882911

"""

# revision identifiers, used by Alembic.
revision = '176f17297061'
down_revision = None

from alembic import op
import sqlalchemy as sa
import geoalchemy2 as ga


def upgrade():
    create_requests()
    create_coverages()
    create_parameters()
    create_errors()
    create_journeys()
    create_journey_sections()

def create_requests():
    op.create_table(
        'requests',
        sa.Column('id', sa.Integer(), primary_key=True, nullable=False),
        sa.Column('request_date', sa.DateTime(), nullable=False),
        sa.Column('user_id', sa.Integer(), nullable=False),
        sa.Column('user_name', sa.Text()),
        sa.Column('app_id', sa.Integer()),
        sa.Column('app_name', sa.Text()),
        sa.Column('request_duration', sa.Integer()),
        sa.Column('api', sa.Text()),
        sa.Column('host', sa.Text()),
        sa.Column('client', sa.Text()),
        sa.Column('response_size', sa.Integer()),
        schema='stat'
    )

def create_coverages():
    op.create_table(
        'coverages',
        sa.Column('region_id', sa.Text()),
        sa.Column('request_id', sa.BigInteger(), nullable=False),
        sa.ForeignKeyConstraint(['request_id'], ['stat.requests.id'],),
        schema='stat'
    )

def create_errors():
    op.create_table(<commit_msg>Stat: create stat schema<commit_after>"""create_all_tables

Revision ID: 176f17297061
Revises: None
Create Date: 2014-04-09 09:15:25.882911

"""

# revision identifiers, used by Alembic.
revision = '176f17297061'
down_revision = None

from alembic import op
import sqlalchemy as sa
import geoalchemy2 as ga


def upgrade():
    create_schema()
    create_requests()
    create_coverages()
    create_parameters()
    create_errors()
    create_journeys()
    create_journey_sections()

def create_schema():
    op.execute("CREATE SCHEMA stat;")

def create_requests():
    op.create_table(
        'requests',
        sa.Column('id', sa.Integer(), primary_key=True, nullable=False),
        sa.Column('request_date', sa.DateTime(), nullable=False),
        sa.Column('user_id', sa.Integer(), nullable=False),
        sa.Column('user_name', sa.Text()),
        sa.Column('app_id', sa.Integer()),
        sa.Column('app_name', sa.Text()),
        sa.Column('request_duration', sa.Integer()),
        sa.Column('api', sa.Text()),
        sa.Column('host', sa.Text()),
        sa.Column('client', sa.Text()),
        sa.Column('response_size', sa.Integer()),
        schema='stat'
    )

def create_coverages():
    op.create_table(
        'coverages',
        sa.Column('region_id', sa.Text()),
        sa.Column('request_id', sa.BigInteger(), nullable=False),
        sa.ForeignKeyConstraint(['request_id'], ['stat.requests.id'],),
        schema='stat'
    )

def create_errors():
    op.create_table(
{'fraction_non_alphanumeric': 0.15802129852284438, 'fraction_numerical': 0.029543112332531776, 'mean_word_length': 3.3723723723723724, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6651369', 'n_tokens_mistral': 989, 'n_tokens_neox': 925, 'n_words': 178}