lrf 3 weeks ago
parent
commit
746d224a62
2 changed files with 3 additions and 2 deletions
  1. 1 1
      src/config/config.local.ts
  2. 2 1
      src/entity/question.entity.ts

+ 1 - 1
src/config/config.local.ts

@@ -31,7 +31,7 @@ export default {
         username: dbUsername,
         password: dbPwd,
         entities: ['./entity'],
-        synchronize: true, // 如果第一次使用,不存在表,有同步的需求可以写 true,注意会丢数据
+        synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true,注意会丢数据
         logging: true,
       }
     },

+ 2 - 1
src/entity/question.entity.ts

@@ -15,7 +15,8 @@ export class Question {
   /**数据版本 */
   @VersionColumn({ type: 'integer', default: 1 })
   __v?: number;
-
+  @Column({ comment: '用户id' })
+  user_id: string;
   @Column({ comment: '问题类型: 1-投诉反馈; 2-意见建议; 3-咨询反馈' })
   type: string;
   @Column({ comment: '姓名' })