Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Commit

Permalink
docs: remove duplicate segment in entities.md (typeorm#4638)
Browse files Browse the repository at this point in the history
Remove duplicate segment.
  • Loading branch information
xiaojianzhong authored and pleerock committed Sep 5, 2019
1 parent 5bd29d5 commit 2478198
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions docs/zh_CN/entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`的特殊列类型,它可以将原始数组值存储在单个字符串列中。
Expand Down

0 comments on commit 2478198

Please sign in to comment.