You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
434 B
19 lines
434 B
import { Model, Table, Column, ForeignKey, BelongsTo, DataType } from 'sequelize-typescript'; |
|
import { User } from '../../users/entities/user.entity'; |
|
|
|
@Table |
|
export class Wallet extends Model<Wallet> { |
|
@ForeignKey(() => User) |
|
@Column |
|
userId: number; |
|
|
|
@BelongsTo(() => User, { onDelete: 'CASCADE' }) |
|
user: User; |
|
|
|
@Column({ |
|
type: DataType.INTEGER, |
|
allowNull: false, |
|
defaultValue: 0, |
|
}) |
|
balance: number; |
|
}
|
|
|