Преглед изворни кода

Merge branch 'starter' of 139-template-116/d8d-vite-starter into starter

18617351030 пре 4 месеци
родитељ
комит
2a1a0902cb
1 измењених фајлова са 24 додато и 0 уклоњено
  1. 24 0
      .roo/rules/10-entity.md

+ 24 - 0
.roo/rules/10-entity.md

@@ -1,5 +1,29 @@
 # 数据库实体规范
 # 数据库实体规范
 
 
+## 常见不规范问题
+  1. nullable 字段用了? 而不是!, 类型没加 null
+    错误示例:
+      ```ts
+      @Column({
+        name: 'description',
+        type: 'text',
+        nullable: true,
+        comment: '容器配置描述'
+      })
+      description?: string;
+      ```
+    正确示例:
+      ```ts
+      @Column({
+        name: 'description',
+        type: 'text',
+        nullable: true,
+        comment: '容器配置描述'
+      })
+      description!: string | null;
+      ```
+
+
 ## 1. 实体基础结构
 ## 1. 实体基础结构
 
 
 ```typescript
 ```typescript