Browse Source

add some useful examples for this project to the template..

main
John-Mark Gurney 2 years ago
parent
commit
21b3122604
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      ui/medashare/alembic/script.py.mako

+ 9
- 0
ui/medashare/alembic/script.py.mako View File

@@ -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"}

Loading…
Cancel
Save