I have a simple SQLAlchemy model, with a column for the ID:
id = Column(Integer, primary_key=True)
This will start the id
at 0, and autoincrement by 1. How do I make it start at 1000
instead of 0
?
I have a simple SQLAlchemy model, with a column for the ID:
id = Column(Integer, primary_key=True)
This will start the id
at 0, and autoincrement by 1. How do I make it start at 1000
instead of 0
?
Maybe this will work for you:
from sqlalchemy.schema import Sequence
id = Column(Integer, Sequence('id_sequence', start=1000, increment=1), primary_key=True)