Complete the code to define a string column named 'username' in a Flask SQLAlchemy model.
username = db.Column(db.[1](50), nullable=False)
The String type defines a text column with a max length. Here, 50 means max 50 characters.
Complete the code to add a primary key constraint to the 'id' column.
id = db.Column(db.Integer, [1]=True)
The primary_key=True marks this column as the table's primary key.
Fix the error in the code to make the 'email' column unique and not nullable.
email = db.Column(db.String(120), unique=[1], nullable=[2])
Both unique and nullable should be set to True and False respectively to enforce uniqueness and non-null values. Here, unique=True and nullable=False.
Fill both blanks to define a column 'age' that stores integers and cannot be null.
age = db.Column(db.[1], [2]=False)
The 'age' column should be an Integer type and must not allow null values, so nullable=False.
Fill all three blanks to define a 'created_at' column with DateTime type, defaulting to current time, and not nullable.
created_at = db.Column(db.[1], default=[2], [3]=False)
The 'created_at' column uses DateTime type, defaults to the current time using func.now(), and cannot be null with nullable=False.