"""Added UploadedFile

Revision ID: c53fdb39f5a5
Revises: 002656878233
Create Date: 2020-12-01 18:18:43.404091

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'c53fdb39f5a5'
down_revision = '002656878233'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('frequency_scan_files',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('name', sa.String(), nullable=False),
        sa.Column('gain', sa.Float(precision=2), nullable=False),
        sa.Column('upload_ip_address', sa.String(), nullable=False),
        sa.Column('upload_timestamp', sa.DateTime(), nullable=False),
        sa.Column('receiver_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(['receiver_id'], ['receivers.id'], ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_frequency_scan_files_receiver_id'), 'frequency_scan_files', ['receiver_id'], unique=False)
    op.create_index(op.f('ix_frequency_scan_files_upload_timestamp'), 'frequency_scan_files', ['upload_timestamp'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_frequency_scan_files_upload_timestamp'), table_name='frequency_scan_files')
    op.drop_index(op.f('ix_frequency_scan_files_receiver_id'), table_name='frequency_scan_files')
    op.drop_table('frequency_scan_files')
    # ### end Alembic commands ###
