from peewee import *
from models import db


class TgBbrids(Model):
    id = AutoField()  # 对应 `id` 字段
    mobile = CharField(max_length=50)  # 对应 `mobile` 字段
    level = CharField(max_length=50, null=True)  # 对应 `level` 字段
    balance = CharField(max_length=50, null=True)  # 对应 `balance` 字段
    remark = CharField(max_length=255, null=True)  # 对应 `remark` 字段
    next_schedule_at = DateTimeField(null=True,
                                     constraints=[SQL('DEFAULT CURRENT_TIMESTAMP')])  # 对应 `next_schedule_at` 字段
    created_at = DateTimeField(null=True, constraints=[SQL('DEFAULT CURRENT_TIMESTAMP')])  # 对应 `created_at` 字段
    updated_at = DateTimeField(null=True, constraints=[
        SQL('DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP')])  # 对应 `updated_at` 字段
    query_id_at = DateTimeField(null=True, constraints=[SQL('DEFAULT CURRENT_TIMESTAMP')])  # 对应 `query_id_at` 字段
    query_id = CharField(max_length=1000, null=True)  # 对应 `query_id` 字段
    baned = IntegerField(default=0)  # 对应 `baned` 字段
    rank = IntegerField(default=0)  # 对应 `rank` 字段
    address = CharField(max_length=100, null=True)  # 对应 `address` 字段
    wallet_status = IntegerField(default=0)  # 对应 `wallet_status` 字段
    modify_nickname = IntegerField(default=0)  # 对应 `modify_nickname` 字段
    modify_nickname_task = IntegerField(default=0)  # 对应 `modify_nickname` 字段

    class Meta:
        database = db
        table_name = 'tg_brids'
