ソースを参照

♻️ refactor(database): adjust field types from tinyint to smallint

- 修改agent表state字段类型为smallint
- 修改card表card_type和state字段类型为smallint
- 修改goods-category表state字段类型为smallint
- 修改goods表goods_type和state字段类型为smallint
- 修改express-company表state字段类型为smallint
- 修改merchant表state字段类型为smallint
- 修改organization表state字段类型为smallint
- 修改supplier表state字段类型为smallint
- 修改city表state字段类型为smallint
- 修改config表state字段类型为smallint
yourname 1 ヶ月 前
コミット
5daa28aa6a

+ 1 - 1
packages/server/src/modules/agent/agent.entity.ts

@@ -35,7 +35,7 @@ export class Agent {
   @Column({ name: 'last_login_ip', type: 'varchar', length: 15, nullable: true, comment: '上次登录IP' })
   lastLoginIp!: string | null;
 
-  @Column({ name: 'state', type: 'tinyint', unsigned: true, default: 2, comment: '状态 1启用 2禁用' })
+  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 2, comment: '状态 1启用 2禁用' })
   state!: number;
 
   @CreateDateColumn({ name: 'created_at', type: 'timestamp', comment: '创建时间' })

+ 2 - 2
packages/server/src/modules/card/card.entity.ts

@@ -9,7 +9,7 @@ export class Card {
   @Column({ name: 'agent_id', type: 'int', unsigned: true, nullable: true, comment: '代理商ID' })
   agentId!: number | null;
 
-  @Column({ name: 'card_type', type: 'tinyint', unsigned: true, comment: '1盛京通卡 2通用联名电子卡' })
+  @Column({ name: 'card_type', type: 'smallint', unsigned: true, comment: '1盛京通卡 2通用联名电子卡' })
   cardType!: number;
 
   @Column({ name: 'card_no', type: 'varchar', length: 20, unique: true, comment: '卡号' })
@@ -18,7 +18,7 @@ export class Card {
   @Column({ name: 'password', type: 'varchar', length: 255, comment: '密码' })
   password!: string;
 
-  @Column({ name: 'state', type: 'tinyint', unsigned: true, default: 1, comment: '状态 1绑定 2解绑 通用联名电子卡不可解绑' })
+  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 1, comment: '状态 1绑定 2解绑 通用联名电子卡不可解绑' })
   state!: number;
 
   @Column({ name: 'face_value', type: 'decimal', precision: 10, scale: 2, unsigned: true, default: 0.00, comment: '面值' })

+ 1 - 1
packages/server/src/modules/goods/goods-category.entity.ts

@@ -18,7 +18,7 @@ export class GoodsCategory {
   @Column({ name: 'level', type: 'int', unsigned: true, default: 0, comment: '层级' })
   level!: number;
 
-  @Column({ name: 'state', type: 'tinyint', unsigned: true, default: 1, comment: '状态 1可用 2不可用' })
+  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 1, comment: '状态 1可用 2不可用' })
   state!: number;
 
   @Column({ name: 'created_at', type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', comment: '创建时间' })

+ 2 - 2
packages/server/src/modules/goods/goods.entity.ts

@@ -33,7 +33,7 @@ export class Goods {
   @Column({ name: 'category_id3', type: 'int', unsigned: true, default: 0, comment: '三级类别id' })
   categoryId3!: number;
 
-  @Column({ name: 'goods_type', type: 'tinyint', unsigned: true, default: 1, comment: '订单类型 1实物产品 2虚拟产品' })
+  @Column({ name: 'goods_type', type: 'smallint', unsigned: true, default: 1, comment: '订单类型 1实物产品 2虚拟产品' })
   goodsType!: number;
 
   @Column({ name: 'supplier_id', type: 'int', unsigned: true, nullable: true, comment: '所属供应商id' })
@@ -62,7 +62,7 @@ export class Goods {
   @Column({ name: 'sort', type: 'int', unsigned: true, default: 0, comment: '排序' })
   sort!: number;
 
-  @Column({ name: 'state', type: 'tinyint', unsigned: true, default: 1, comment: '状态 1可用 2不可用' })
+  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 1, comment: '状态 1可用 2不可用' })
   state!: number;
 
   @Column({ name: 'stock', type: 'bigint', unsigned: true, default: 0, comment: '库存' })

+ 1 - 1
packages/server/src/modules/logistics/express-company.entity.ts

@@ -11,7 +11,7 @@ export class ExpressCompany {
   @Column({ name: 'code', type: 'varchar', length: 20, comment: '物流编号' })
   code!: string;
 
-  @Column({ name: 'state', type: 'tinyint', unsigned: true, default: 1, comment: '使用状态 1可用 2禁用' })
+  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 1, comment: '使用状态 1可用 2禁用' })
   state!: number;
 
   @Column({ name: 'sort', type: 'int', unsigned: true, nullable: true, comment: '优先级 值越大越优先' })

+ 1 - 1
packages/server/src/modules/merchant/merchant.entity.ts

@@ -35,7 +35,7 @@ export class Merchant {
   @Column({ name: 'last_login_ip', type: 'varchar', length: 15, nullable: true, comment: '上次登录IP' })
   lastLoginIp!: string | null;
 
-  @Column({ name: 'state', type: 'tinyint', unsigned: true, default: 2, comment: '状态 1启用 2禁用' })
+  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 2, comment: '状态 1启用 2禁用' })
   state!: number;
 
   @Column({ name: 'rsa_public_key', type: 'varchar', length: 2000, nullable: true, comment: '公钥' })

+ 1 - 1
packages/server/src/modules/organization/organization.entity.ts

@@ -14,7 +14,7 @@ export class Organization {
   @Column({ name: 'level', type: 'int', unsigned: true, default: 4, comment: '层级' })
   level!: number;
 
-  @Column({ name: 'state', type: 'tinyint', unsigned: true, default: 1, comment: '状态 1可用 2不可用' })
+  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 1, comment: '状态 1可用 2不可用' })
   state!: number;
 
   @CreateDateColumn({ name: 'created_at', type: 'timestamp', comment: '创建时间' })

+ 1 - 1
packages/server/src/modules/supplier/supplier.entity.ts

@@ -35,7 +35,7 @@ export class Supplier {
   @Column({ name: 'last_login_ip', type: 'varchar', length: 15, nullable: true, comment: '上次登录IP' })
   lastLoginIp!: string | null;
 
-  @Column({ name: 'state', type: 'tinyint', unsigned: true, default: 2, comment: '状态 1启用 2禁用' })
+  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 2, comment: '状态 1启用 2禁用' })
   state!: number;
 
   @CreateDateColumn({ name: 'created_at', type: 'timestamp', comment: '创建时间' })

+ 1 - 1
packages/server/src/modules/system/city.entity.ts

@@ -14,7 +14,7 @@ export class City {
   @Column({ name: 'parent_id', type: 'bigint', unsigned: true, default: 0, comment: '上级id' })
   parentId!: number;
 
-  @Column({ name: 'state', type: 'tinyint', unsigned: true, default: 1, comment: '状态 1可用' })
+  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 1, comment: '状态 1可用' })
   state!: number;
 
   @Column({ name: 'sort', type: 'int', unsigned: true, default: 0, comment: '排序数值越大越靠前' })

+ 1 - 1
packages/server/src/modules/system/config.entity.ts

@@ -11,7 +11,7 @@ export class Config {
   @Column({ name: 'value', type: 'varchar', length: 255, comment: '配置值' })
   value!: string;
 
-  @Column({ name: 'state', type: 'tinyint', unsigned: true, default: 2, comment: '状态 1可用 2禁用' })
+  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 2, comment: '状态 1可用 2禁用' })
   state!: number;
 
   @CreateDateColumn({ name: 'created_at', type: 'timestamp', comment: '创建时间' })