from peewee import *
from models import db


class TgKoni(Model):
    id = AutoField()  # 对应 AUTO_INCREMENT
    phone = CharField(max_length=255, null=True)  # 对应 `phone` 字段
    user_data = CharField(max_length=999, null=True)  # 对应 `user_data` 字段
    token = CharField(max_length=999, null=True)  # 新增 `token` 字段
    fraction = CharField(max_length=255, null=True)  # 新增 `fraction` 字段
    address = CharField(max_length=255, null=True)  # 新增 `address` 字段
    address1 = CharField(max_length=255, null=True)  # 新增 `address1` 字段
    num = IntegerField(null=True)  # 数字，允许为空
    wallet_start = IntegerField(null=True)  # 数字，允许为空
    code = CharField(max_length=255, null=True)  # 新增 `address1` 字段
    server_ip = CharField(max_length=255, null=True)  # 新增 `address1` 字段

    class Meta:
        database = db  # 确保这里指向你的数据库实例
        table_name = 'tg_koni'  # 指定表名
