SQLite doesn't support an initial value for auto-incrementing fields. It has
two flavors of autoincrement, the ROWID and AUTOINCREMENT versions. By setting
sqlite_autoincrement it means you're choosing AUTOINCREMENT. But neither
support a way to set the initial value, see
http://sqlite.org/lang_createtable.html and http://sqlite.org/autoinc.html.
On Apr 18, 2012, at 11:27 PM, Phoebe pei wrote:
> class MyMode(Base):
> __tablename__ = 'mymodel'
> __table_args__ = ({
> 'sqlite_autoincrement' : True,
> })
>
> id = Column(Integer, primary_key=True)
>
> def __init__(self, id):
> self.id = id
>
> How can I set the initial value for the id column?
>
>
> --
> 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/-/j2DcE3bYYIIJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sqlalchemy?hl=en.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.