0del / alembic-example

PostgreSQL migration with Alembic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

alembic example

New database

1. Init alembic

$ alembic init migrate

2. Config in alembic.init file

sqlalchemy.url = postgresql://root:secret@localhost:5432/migration

Make sure: You have import your models in env.py, like this:

from project.models import Base, a_class, b_class

That make sure the a_class and b_class will register to alembic integration.

Existing database

$ alembic stamp head

Contributing

If you want to colaborate check the project's issues.

  1. Fork the repository
  2. Implement your solution
  3. Commit
  4. Open a Pull Request

Thanks!

About

PostgreSQL migration with Alembic

License:MIT License


Languages

Language:Python 89.0%Language:Mako 11.0%