Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an SQLAlchemy equivalent of django-evolution?

All I want is to have a workflow somewhat similar to:

  1. Add django_evolution to the INSTALLED_APPS for your project
  2. Run ./manage.py syncdb
  3. Make modifications to the model files in your project
  4. Run ./manage.py evolve --hint --execute

Which is super simple and even though it doesn't support advanced features (like multiple databases) it does know how to add/remove columns which is a common use case.

sqlalchemy-migrate has an insanely complex workflow in comparison and both tutorials (1, 2) referenced by the docs are either outdated or irrelevant.

like image 378
ubershmekel Avatar asked Dec 05 '11 08:12

ubershmekel


People also ask

Is SQLAlchemy better than Django ORM?

In addition to this, since it interacts directly with the database, you can simply run the queries against the database without actually using the ORM. Plus, SQLAlchemy is much more powerful than Django, albeit with a little higher learning curve.

Is Django ORM based on SQLAlchemy?

SQLAlchemy ORM is similar to Django ORM, but at the same time, they differ. SQLAlchemy ORM uses a different concept, Data Mapper, compared to Django's Active Record approach.


2 Answers

I think you already tried your hand on DJango :). These are the functionality right now not available with current SQLAlchemy. Suggested by @madjar you can use development version of Alembic or you can use sqlalchemy-migrate. Relevant post is already in stack overflow.

like image 181
Nilesh Avatar answered Oct 22 '22 11:10

Nilesh


The creator of SQLAlchemy recently started working on Alembic. While it's still young (version 0.1), it may suits your needs.

like image 2
madjar Avatar answered Oct 22 '22 11:10

madjar