Skip to content

Instantly share code, notes, and snippets.

@cnicodeme
Created August 30, 2018 12:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cnicodeme/a06058114985638a975c08904fc968c0 to your computer and use it in GitHub Desktop.
Save cnicodeme/a06058114985638a975c08904fc968c0 to your computer and use it in GitHub Desktop.
Migration script to do raw SQL requests
# Add this import:
from sqlalchemy.sql import text
def upgrade():
# ...
conn = op.get_bind()
conn.execute(text('UPDATE ...'))
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment