|
|
@@ -7,6 +7,7 @@ Create Date: ${create_date} |
|
|
|
""" |
|
|
|
from alembic import op |
|
|
|
import sqlalchemy as sa |
|
|
|
from medashare import mdb |
|
|
|
${imports if imports else ""} |
|
|
|
|
|
|
|
# revision identifiers, used by Alembic. |
|
|
@@ -19,6 +20,14 @@ depends_on = ${repr(depends_on)} |
|
|
|
def upgrade() -> None: |
|
|
|
${upgrades if upgrades else "pass"} |
|
|
|
|
|
|
|
connection = op.get_bind() |
|
|
|
|
|
|
|
mdo = sa.schema.MetaData() |
|
|
|
#mdotbl = sa.Table('metadata_objects', mdo, autoload_with=connection.engine) |
|
|
|
|
|
|
|
#stmt = sa.select([mdotbl.c.uuid, mdotbl.c.data]) |
|
|
|
#newtypes = [ dict(olduuid=uuid, newtype=mdb.MDBase.decode(data).type) for |
|
|
|
# uuid, data in connection.execute(stmt) ] |
|
|
|
|
|
|
|
def downgrade() -> None: |
|
|
|
${downgrades if downgrades else "pass"} |