From 2478198642fe099758688e44360c2b7b11993580 Mon Sep 17 00:00:00 2001 From: azxj <31400828+azxj@users.noreply.github.com> Date: Thu, 5 Sep 2019 20:29:23 +0800 Subject: [PATCH] docs: remove duplicate segment in entities.md (#4638) Remove duplicate segment. --- docs/zh_CN/entities.md | 43 ------------------------------------------ 1 file changed, 43 deletions(-) diff --git a/docs/zh_CN/entities.md b/docs/zh_CN/entities.md index f56d8f7c3c..95f47560b4 100644 --- a/docs/zh_CN/entities.md +++ b/docs/zh_CN/entities.md @@ -346,49 +346,6 @@ export class User { } ``` -### `simple-array` column type - -`postgres`和`mysql`支持`enum`列类型。 有多种列定义方式: - -使用 typescript 枚举: - -```typescript -export enum UserRole { - ADMIN = "admin", - EDITOR = "editor" - GHOST = "ghost" -} - @Entity() -export class User { - @PrimaryGeneratedColumn() - id: number; - @Column({ - type: "enum", - enum: UserRole, - default: UserRole.GHOST - }) - role: UserRole - } -``` - -> 注意:支持字符串,数字和异构枚举。 -> 使用带枚举值的数组: - -```typescript -export type UserRoleType = "admin" | "editor" | "ghost", - @Entity() -export class User { - @PrimaryGeneratedColumn() - id: number; - @Column({ - type: "enum", - enum: ["admin", "editor", "ghost"], - default: "ghost" - }) - role: UserRoleType -} -``` - ### `simple-array`的列类型 有一种称为`simple-array`的特殊列类型,它可以将原始数组值存储在单个字符串列中。