"""empty message

Revision ID: af08550a6fef
Revises: b5edaa4713e3
Create Date: 2022-07-08 18:44:44.160101

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

# revision identifiers, used by Alembic.
revision = 'af08550a6fef'
down_revision = 'b5edaa4713e3'
branch_labels = None
depends_on = None


from cidc_schemas.migrations import v0_25_41_to_v0_25_42

from cidc_api.models.migrations import run_metadata_migration


def upgrade():
    run_metadata_migration(v0_25_41_to_v0_25_42.upgrade, True)

    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('assay_uploads', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('assay_uploads', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('assay_uploads', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=False)
    op.alter_column('downloadable_files', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('downloadable_files', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('downloadable_files', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=False)
    op.alter_column('manifest_uploads', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('manifest_uploads', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('manifest_uploads', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=False)
    op.alter_column('permissions', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('permissions', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('permissions', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=False)
    op.alter_column('trial_metadata', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('trial_metadata', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('trial_metadata', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=False)
    op.alter_column('upload_jobs', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('upload_jobs', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('upload_jobs', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=False)
    op.alter_column('users', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('users', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('users', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=False)
    # ### end Alembic commands ###


def downgrade():
    run_metadata_migration(v0_25_41_to_v0_25_42.downgrade, True)

    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('users', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=True)
    op.alter_column('users', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('users', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('upload_jobs', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=True)
    op.alter_column('upload_jobs', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('upload_jobs', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('trial_metadata', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=True)
    op.alter_column('trial_metadata', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('trial_metadata', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('permissions', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=True)
    op.alter_column('permissions', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('permissions', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('manifest_uploads', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=True)
    op.alter_column('manifest_uploads', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('manifest_uploads', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('downloadable_files', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=True)
    op.alter_column('downloadable_files', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('downloadable_files', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('assay_uploads', '_etag',
               existing_type=sa.VARCHAR(length=40),
               nullable=True)
    op.alter_column('assay_uploads', '_updated',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('assay_uploads', '_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    # ### end Alembic commands ###
