Columns, Types, and Constraints
Pick column types and add nullable and unique.
Types Shape Your Data
Every column has a type that decides what it can hold and how the database stores it. Picking the right one keeps data clean. 🎯
Integer for Whole Numbers
Use db.Integer for counts, ids, and ages. It stores whole numbers efficiently and is the usual choice for primary keys.
age = db.Column(db.Integer)All lessons in this course
- Install and Configure the Extension
- Define Your First Model Class
- Columns, Types, and Constraints
- Create the Schema with create_all