<commit_before>"""Create payment transaction table

Revision ID: 324c23d14151
Revises: <PASSWORD>
Create Date: 2014-12-05 10:10:04.325749
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

from indico.core.db.sqlalchemy.custom.utcdatetime import UTCDateTime

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


def upgrade():
    op.create_table('payment_transactions',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('event_id', sa.Integer(), nullable=False, index=True),
                    sa.Column('registrant_id', sa.Integer(), nullable=False),
                    sa.Column('status', sa.SmallInteger(), nullable=False),
                    sa.Column('amount', sa.Numeric(precision=8, scale=2), nullable=False),
                    sa.Column('currency', sa.String(), nullable=False),
                    sa.Column('timestamp', UTCDateTime(), nullable=False, index=True),
                    sa.Column('provider', sa.String(), nullable=False),
                    sa.Column('data', postgresql.JSON(), nullable=False),
                    sa.CheckConstraint('amount > 0'),
                    sa.CheckConstraint('status IN (1, 2, 3, 4)'),
                    sa.PrimaryKeyConstraint('id'),
                    sa.UniqueConstraint('event_id', 'registrant_id', 'timestamp'),
                    schema='events')


def downgrade():
    op.drop_table('payment_transactions', schema='events')
<commit_msg>Update migration for transactions table<commit_after>"""Create payment transaction table

Revision ID: 324c23d14151
Revises: <PASSWORD>
Create Date: 2014-12-05 10:10:04.325749
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

from indico.core.db.sqlalchemy.custom.utcdatetime import UTCDateTime

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


def upgrade():
    op.create_table('payment_transactions',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('event_id', sa.Integer(), nullable=False, index=True),
                    sa.Column('registrant_id', sa.Integer(), nullable=False),
                    sa.Column('status', sa.SmallInteger(), nullable=False),
                    sa.Column('amount', sa.Numeric(precision=8, scale=2), nullable=False),
                    sa.Column('currency', sa.String(), nullable=False),
                    sa.Column('timestamp', UTCDateTime(), nullable=False, index=True),
                    sa.Column('provider', sa.String(), nullable=False),
                    sa.Column('data', postgresql.JSON(), nullable=False),
                    sa.CheckConstraint('amount > 0'),
                    sa.CheckConstraint('status IN (1, 2, 3, 4, 5)'),
                    sa.PrimaryKeyConstraint('id'),
                    sa.UniqueConstraint('event_id', 'registrant_id', 'timestamp'),
                    schema='events')


def downgrade():
    op.drop_table('payment_transactions', schema='events')

{'fraction_non_alphanumeric': 0.1355004827808175, 'fraction_numerical': 0.028644995172191826, 'mean_word_length': 2.656470588235294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '4558838', 'n_tokens_mistral': 956, 'n_tokens_neox': 862, 'n_words': 181}