In our team, right now all developers are using sqlite as a testing database in 
which we have defined all of the tables in the schema and inserted all of the 
dataset. Eventually we will support 4 to 6 databases, such as MySQL, 
Postgresql, etc. At the beginning when reading alembic tutorial web site:
http://alembic.readthedocs.org/en/latest/tutorial.html
, I googled if alembic migration tool will automatically pull out the schemas 
from Sqlite into a schema model file in which all of the table schemas were 
defined as classes, such as:
class SomeClass(Base):
    __tablename__ = 'some_table'
    id = Column(Integer, primary_key=True)
    name =  Column(String(50))
if it is successful, it will save us lots of time, and we don't need to write 
the table classes by hand. Unfortunately I couldn't figure out how to do it, 
and maybe it is impossible. So we ended up writting all of the table classes by 
hand, and use alembic's 'autogenerate' command to automatically generate the 
migration script. Then update the migration script to make it compatiable with 
all supporting databases. Finally run 'alembic upgrade head' against supporting 
databases. We are not sure if we are doing right thing,and would like to have 
your suggestions. Thanks so much!

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/pj7ZXTwPQPsJ.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to