On Nov 6, 2012, at 1:59 PM, junepeach wrote:

> 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))

Alembic doesn't generate ORM models.  At best, it will generate migration 
directives that represent the changes between a database schema and the tables 
as defined in your application as either Table objects or declarative models.


> if it is successful, it will save us lots of time, and we don't need to write 
> the table classes by hand.

the usual model is that the table metadata is defined in Python, and that 
metadata is used to generate schemas.    Right now it seems like your 
developers are writing schemas by hand in SQLite, so there's always the task of 
"writing the tables by hand", its just where and when you do it that changes.


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
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