import datetime

from peewee import *
from models import db

class TelegramAccountInfo(Model):
    id = AutoField(primary_key=True)
    areacode = CharField(max_length=50, null=True)
    phone = CharField(max_length=50, unique=True)
    device_model = CharField(max_length=50)
    is_valid_session = BooleanField(default=False)
    is_edit_2fa = BooleanField(default=False)
    is_unAuth_device = BooleanField(default=False)
    is_login_emulator = BooleanField(default=False)
    emulator_model = CharField(max_length=50, null=True)
    host = CharField(max_length=50, null=True)
    index_id = IntegerField(null=True)
    is_valid_emulator = IntegerField(null=True)
    create_date = DateTimeField(default=datetime.datetime.now)
    emulator_date = CharField(max_length=255, null=True)
    message = CharField(max_length=50, null=True)

    class Meta:
        database = db
        table_name = 'telegram_account_info'