crown
crown copied to clipboard
创建超级表时,如果meta中tags类型为NCharField类型,则会变成创建普通表
class Meters(SuperModel):
gps = NCharField(db_column='gps')
class Meta:
database = db
db_table = 'meters'
groupid = NCharField(db_column='gid')
if __name__ == '__main__':
Meters.create_table(safe=True)
此时的sql被错误解析为
CREATE TABLE "orc.meters" ("ts" TIMESTAMP, "gps" NCHAR(255))
当groupid类型改为其他类型后 可正常创建 sql亦正常
CREATE TABLE "orc.meters" ("ts" TIMESTAMP, "gps" NCHAR(255)) TAGS ("gid" BOOL)
将crown.py中的
and not isinstance(v, NCharField)
删除即可