Skip to content

Instantly share code, notes, and snippets.

@daaniam
Last active July 23, 2024 00:56
Show Gist options
  • Save daaniam/ecff3f2591c7716f33587a682d7a4f25 to your computer and use it in GitHub Desktop.
Save daaniam/ecff3f2591c7716f33587a682d7a4f25 to your computer and use it in GitHub Desktop.
alembic

Alembic

Custom file name template

# alembic.ini
file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s

Overide sqlalchemy database url from config file

# env.py
config.set_main_option("sqlalchemy.url", app_config.POSTGRES_DSN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment