1313 from backend .plugin .code_generator .model import GenBusiness
1414
1515
16- class GenModel (DataClassBase ):
17- """代码生成模型表 """
16+ class GenColumn (DataClassBase ):
17+ """代码生成模型列表 """
1818
19- __tablename__ = 'sys_gen_model '
19+ __tablename__ = 'gen_column '
2020
2121 id : Mapped [id_key ] = mapped_column (init = False )
2222 name : Mapped [str ] = mapped_column (String (50 ), comment = '列名称' )
2323 comment : Mapped [str | None ] = mapped_column (String (255 ), default = None , comment = '列描述' )
24- type : Mapped [str ] = mapped_column (String (20 ), default = 'str ' , comment = 'SQLA 模型列类型' )
24+ type : Mapped [str ] = mapped_column (String (20 ), default = 'String ' , comment = 'SQLA 模型列类型' )
2525 pd_type : Mapped [str ] = mapped_column (String (20 ), default = 'str' , comment = '列类型对应的 pydantic 类型' )
2626 default : Mapped [str | None ] = mapped_column (
2727 LONGTEXT ().with_variant (TEXT , 'postgresql' ), default = None , comment = '列默认值'
@@ -33,6 +33,6 @@ class GenModel(DataClassBase):
3333
3434 # 代码生成业务模型一对多
3535 gen_business_id : Mapped [int ] = mapped_column (
36- ForeignKey ('sys_gen_business .id' , ondelete = 'CASCADE' ), default = 0 , comment = '代码生成业务ID'
36+ ForeignKey ('gen_business .id' , ondelete = 'CASCADE' ), default = 0 , comment = '代码生成业务ID'
3737 )
38- gen_business : Mapped [Union ['GenBusiness' , None ]] = relationship (init = False , back_populates = 'gen_model ' )
38+ gen_business : Mapped [Union ['GenBusiness' , None ]] = relationship (init = False , back_populates = 'gen_column ' )
0 commit comments