59 lines
2.1 KiB
Python
59 lines
2.1 KiB
Python
"""Added Testday-related tables
|
|
|
|
Revision ID: 3e508b27e5b6
|
|
Revises: 293b84dc3f9e
|
|
Create Date: 2015-05-07 11:04:01.305712
|
|
|
|
"""
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '3e508b27e5b6'
|
|
down_revision = '293b84dc3f9e'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
def upgrade():
|
|
### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('event',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('name', sa.Text(), nullable=True),
|
|
sa.Column('metadata_url', sa.Text(), nullable=True),
|
|
sa.Column('testday_url', sa.Text(), nullable=True),
|
|
sa.Column('resultsdb_job_id', sa.Integer(), nullable=True),
|
|
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_table('category',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('event_id', sa.Integer(), nullable=True),
|
|
sa.Column('name', sa.Text(), nullable=True),
|
|
sa.Column('col_1_name', sa.Text(), nullable=True),
|
|
sa.ForeignKeyConstraint(['event_id'], ['event.id'], ),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_index('category_fk_event_id', 'category', ['event_id'], unique=False)
|
|
op.create_table('testcase',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('category_id', sa.Integer(), nullable=True),
|
|
sa.Column('name', sa.Text(), nullable=True),
|
|
sa.Column('type', sa.Enum('tc', 'txt', name='testcase_type'), nullable=True),
|
|
sa.Column('url', sa.Text(), nullable=True),
|
|
sa.ForeignKeyConstraint(['category_id'], ['category.id'], ),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_index('testcase_fk_category_id', 'testcase', ['category_id'], unique=False)
|
|
### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index('testcase_fk_category_id', table_name='testcase')
|
|
op.drop_table('testcase')
|
|
op.drop_index('category_fk_event_id', table_name='category')
|
|
op.drop_table('category')
|
|
op.drop_table('event')
|
|
### end Alembic commands ###
|