Skip to content

Instantly share code, notes, and snippets.

@TripleMap
Last active March 30, 2018 21:05
Show Gist options
  • Save TripleMap/18763f16e58b724ec119613726877507 to your computer and use it in GitHub Desktop.
Save TripleMap/18763f16e58b724ec119613726877507 to your computer and use it in GitHub Desktop.
export class users_layers extends Model<users_layers> {
@AutoIncrement
@PrimaryKey
@Column(DataType.INTEGER)
id: number;
@ForeignKey(() => users)
@Column(DataType.CHAR(100))
@BelongsTo(() => users)
user_id: string;
@Column(DataType.CHAR(100))
layer_id: string;
}
export class users extends Model<users> {
@IsUUID(4)
@PrimaryKey
@Column(DataType.CHAR(100))
@HasMany(() => users_layers)
user_layers: users_layers[]
id: string;
@Column(DataType.CHAR(2044))
user_name: string;
@Column(DataType.CHAR(2044))
password: string;
@IsEmail
@Column(DataType.CHAR(2044))
email: Date;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment