feat: 代码生成新增字段唯一性配置

This commit is contained in:
insistence
2025-02-18 16:10:57 +08:00
parent 2a486dc01e
commit fd07ad088c
13 changed files with 26 additions and 14 deletions

View File

@@ -15,7 +15,7 @@ class {{ ClassName }}(Base):
__tablename__ = '{{ tableName }}'
{% for column in columns %}
{{ column.column_name }} = Column({{ column.column_type | get_sqlalchemy_type }}, {% if column.pk %}primary_key=True, {% endif %}{% if column.increment %}autoincrement=True, {% endif %}{% if column.required %}nullable=True{% else %}nullable=False{% endif %}, comment='{{ column.column_comment }}')
{{ column.column_name }} = Column({{ column.column_type | get_sqlalchemy_type }}, {% if column.pk %}primary_key=True, {% endif %}{% if column.increment %}autoincrement=True, {% endif %}{% if column.required or column.pk %}nullable=False{% else %}nullable=True{% endif %}, comment='{{ column.column_comment }}')
{% endfor %}
{% if table.sub %}