Skip to content

Commit

Permalink
Set comment for fk field if db_constraint is False (#1679)
Browse files Browse the repository at this point in the history
  • Loading branch information
abondar committed Jul 26, 2024
1 parent 82abb00 commit cf54410
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tortoise/backends/base/schema_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def _get_table_sql(self, model: "Type[Model]", safe: bool = True) -> dict:
nullable=nullable,
unique=unique,
is_primary_key=field_object.pk,
comment="",
comment=comment if not reference.db_constraint else "",
default=default,
) + (
self._create_fk_string(
Expand Down

0 comments on commit cf54410

Please sign in to comment.