typing and db types
This commit is contained in:
parent
e455b5c8f6
commit
5fdfdcbd1f
9 changed files with 70 additions and 43 deletions
|
@ -8,7 +8,7 @@ export class communication {
|
|||
id: number;
|
||||
|
||||
@Column({ type: "boolean", default: false })
|
||||
preffered: boolean;
|
||||
preferred: boolean;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
mobile: string;
|
||||
|
|
|
@ -11,7 +11,19 @@ export class member {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "enum", enum: Salutation, default: Salutation.none })
|
||||
@Column({
|
||||
type: "varchar",
|
||||
length: "255",
|
||||
default: Salutation.none.toString(),
|
||||
transformer: {
|
||||
to(value: Salutation) {
|
||||
return value.toString();
|
||||
},
|
||||
from(value: string) {
|
||||
return Salutation[value as keyof typeof Salutation];
|
||||
},
|
||||
},
|
||||
})
|
||||
salutation: Salutation;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue