Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个简单的 SQLAlchemy 模型,有一个 ID 列:
id = Column(Integer, primary_key=True)
这将从id0 开始,并按 1 自动递增。如何使它从 0 开始1000而不是0?
id
1000
0
也许这对你有用:
from sqlalchemy.schema import Sequence id = Column(Integer, Sequence('id_sequence', start=1000, increment=1), primary_key=True)