class SearchEngineCheck(Model):
    category = CharField()
    track_source_id = IntegerField()
    keyword = CharField()
    clip_len = IntegerField(null=True)
    has_error = BooleanField(default=False)
    created_at = DateTimeField(
        null=False,
        constraints=[SQL('DEFAULT CURRENT_TIMESTAMP')],
        help_text='使用数据库时间'
    )
    updated_at = DateTimeField(
        null=False,
        constraints=[
            SQL('DEFAULT CURRENT_TIMESTAMP'),
            SQL('ON UPDATE CURRENT_TIMESTAMP'),
        ]
    )

    class Meta:
        database = db
        table_name = 'parse_monitoring'
        indexes = (
            ('parsed_at', 'track_source_id'),
        )

universe_king
3.4k 声望680 粉丝