How to design an LDAP schema?

Does SQLAlchemy discourage the modification of database schema by design?

  • This is a follow-up question to I am kinda confused on this design.  Does SQLAlchemy discourage modification?  In the FAQ they suggested us to use SQLAlchemy-Migrate (as in the previous question) and DDL API. Either way is not as straightforward as other applications of SQLAlchemy. So I guess the philosophy of SA is that we should not alter table frequently. I am a rookie in Database database schema by design. Is my guess right?

  • Answer:

    Not altering tables frequently is more a philosophy of database design generally, than of SQLAlchemy specifically. But there are cases (our data warehousing application being one) where you do want to modify tables liberally, and SQLAlchemy does not hold you back. You must either (a) update and restart your app on DB schema changes, or (b) make it aware of such changes and able to discard and recreate any table and mapper instances it holds when they go out of sync with the DB. You probably don't want (b), being a self-confessed rookie in database schema design. But our data warehousing app does that merrily and constantly, and SQLAlchemy is serving us well for it. SQLAlchemy-Migrate helps you manage schema changes sensibly. That is certainly something you want to do, and people say SQLAlchemy-Migrate serves the purpose well (I haven't tried it myself; we use a homegrown system based on SQLAlchemy itself). Check out the book Refactoring Databases by Scott W. Ambler and Pramod J. Sadalage for more on sensibly managing database schema changes.

Gunnlaugur Þór Briem at Quora Visit the source

Was this solution helpful to you?

Other answers

The recent preferred way is definitely (http://alembic.readthedocs.org/) which is written by Michael Bayer, the creator of SQLAlchemy.

Hong Minhee (洪 民憙)

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.