op.execute('ALTER TYPE protocolbuilderstatus RENAME TO pbs_old;')
op.execute("CREATE TYPE protocolbuilderstatus AS ENUM('INCOMPLETE', 'ACTIVE', 'HOLD', 'OPEN', 'ABANDONED')")
op.execute("ALTER TABLE study ALTER COLUMN protocol_builder_status TYPE protocolbuilderstatus USING protocol_builder_status::text::protocolbuilderstatus;")
op.execute('DROP TYPE pbs_old;')
defdowngrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute('ALTER TYPE protocolbuilderstatus RENAME TO pbs_old;')
op.execute("CREATE TYPE protocolbuilderstatus AS ENUM('DRAFT', 'IN_PROCESS', 'IN_REVIEW', 'REVIEW_COMPLETE', 'INACTIVE')")
op.execute("ALTER TABLE study ALTER COLUMN protocol_builder_status TYPE protocolbuilderstatus USING protocol_builder_status::text::protocolbuilderstatus;")