2025-10-13 10:20:23 +08:00
|
|
|
from peewee import *
|
|
|
|
|
|
|
|
|
|
from models import db
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Weex(Model):
|
|
|
|
|
id = IntegerField(primary_key=True)
|
|
|
|
|
open = FloatField(null=True)
|
|
|
|
|
high = FloatField(null=True)
|
|
|
|
|
low = FloatField(null=True)
|
|
|
|
|
close = FloatField(null=True)
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
database = db
|
|
|
|
|
table_name = 'weex'
|
|
|
|
|
|
2025-10-13 11:22:02 +08:00
|
|
|
|
2025-10-13 10:20:23 +08:00
|
|
|
# 连接到数据库
|
|
|
|
|
db.connect()
|
|
|
|
|
|
|
|
|
|
# 创建表(如果表不存在)
|
|
|
|
|
db.create_tables([Weex])
|