14 lines
615 B
Python
14 lines
615 B
Python
from peewee import *
|
||
from models import db, BaseModel # 假设 db 是已经在其他地方定义的数据库连接
|
||
|
||
|
||
class TgZoo(BaseModel):
|
||
id = AutoField(primary_key=True) # 对应 `id` 列,自动递增的主键
|
||
phone = CharField(max_length=255, null=True) # 对应 `phone` 列,最大长度 255,允许为空
|
||
user_data = CharField(max_length=999, null=True) # 对应 `user_data` 列,最大长度 999,允许为空
|
||
wallet_id = IntegerField(null=True) # 数字,允许为空
|
||
|
||
class Meta:
|
||
database = db # 指定数据库连接
|
||
table_name = 'tg_zoo' # 指定表名
|