mirror of
https://github.com/fastapi/sqlmodel.git
synced 2025-10-30 01:28:25 +08:00
✨ Document indexes and make them opt-in (#205)
This commit is contained in:
committed by
GitHub
parent
3d7b74746c
commit
155c6178cd
@ -426,7 +426,7 @@ def get_column_from_field(field: ModelField) -> Column: # type: ignore
|
||||
nullable = not field.required
|
||||
index = getattr(field.field_info, "index", Undefined)
|
||||
if index is Undefined:
|
||||
index = True
|
||||
index = False
|
||||
if hasattr(field.field_info, "nullable"):
|
||||
field_nullable = getattr(field.field_info, "nullable")
|
||||
if field_nullable != Undefined:
|
||||
|
||||
Reference in New Issue
Block a user