This video introduces Alembic, which is a migration package in Python for managing changes to your databases.
We'll look at how to setup a Migration Environment and define revisions with upgrade and downgrade operations. We'll also look at how to integrate Alembic with SQLAlchemy models, and how to use this to autogenerate revisions.
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
01:01 Setting up PostgreSQL database container (Docker)
04:09 Installing Alembic
04:43 Creating Alembic Migration Environment
06:40 Connecting Alembic to Database with Connection String
07:49 Creating revision with alembic revision command
16:47 Alembic history, downgrades and relative migrations
20:07 Autogenerating migrations from SQLAlchemy Model Classes
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: https://bugbytes.io/posts/
👾 Github: https://github.com/bugbytes-io/
🐦 Twitter: https://twitter.com/bugbytesio
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Docker Postgres Image: https://hub.docker.com/_/postgres
Alembic: https://alembic.sqlalchemy.org/en/latest/index.html
Alembic Tutorial: https://alembic.sqlalchemy.org/en/latest/tutorial.html#tutorial
Alembic Autogenerating Migrations: https://alembic.sqlalchemy.org/en/latest/autogenerate.html
#python #webdevelopment