import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('user_wallets')
export class UserWallets {
  @PrimaryGeneratedColumn({
    type: 'bigint',
    comment: '主键ID',
  })
  id: bigint;

  @Column({
    type: 'bigint',
    nullable: false,
    unique: true,
    comment: '关联users.id',
  })
  user_id: bigint;

  @Column({
    type: 'int',
    nullable: false,
    default: 0,
    comment: '鲸币余额',
  })
  balance: number;

  @Column({
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
    comment: '创建时间',
  })
  created_at: Date;

  @Column({
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
    onUpdate: 'CURRENT_TIMESTAMP',
    comment: '更新时间',
  })
  updated_at: Date;
}
