fix fields string

This commit is contained in:
Cayo Puigdefabregas 2023-03-01 18:06:41 +01:00
parent 12b196fd8e
commit b6b5e5d29d
2 changed files with 7 additions and 6 deletions

View File

@ -117,7 +117,7 @@ def upgrade():
['issuer_id'], ['issuer_id'],
['common.user.id'], ['common.user.id'],
), ),
sa.Column('key', sa.Unicode(), nullable=False), sa.Column('key', citext.CIText(), nullable=False),
sa.PrimaryKeyConstraint('id'), sa.PrimaryKeyConstraint('id'),
schema=f'{get_inv()}', schema=f'{get_inv()}',
) )

View File

@ -1,3 +1,4 @@
from citext import CIText
from flask import g from flask import g
from sortedcontainers import SortedSet from sortedcontainers import SortedSet
from sqlalchemy import BigInteger, Column, ForeignKey, Sequence, Unicode from sqlalchemy import BigInteger, Column, ForeignKey, Sequence, Unicode
@ -25,9 +26,9 @@ class Proof(Thing):
id = Column(BigInteger, Sequence('device_seq'), primary_key=True) id = Column(BigInteger, Sequence('device_seq'), primary_key=True)
id.comment = """The identifier of the device for this database. Used only id.comment = """The identifier of the device for this database. Used only
internally for software; users should not use this.""" internally for software; users should not use this."""
documentId = Column(Unicode(STR_SM_SIZE), nullable=True) documentId = Column(CIText(), nullable=True)
documentId.comment = "is the hash of snapshot.json_wb" documentId.comment = "is the hash of snapshot.json_wb"
documentSignature = Column(Unicode(STR_SM_SIZE), nullable=True) documentSignature = Column(CIText(), nullable=True)
documentSignature.comment = "is the snapshot.json_wb with the signature of the user" documentSignature.comment = "is the snapshot.json_wb with the signature of the user"
timestamp = Column(BigInteger, nullable=False) timestamp = Column(BigInteger, nullable=False)
type = Column(Unicode(STR_SM_SIZE), nullable=False) type = Column(Unicode(STR_SM_SIZE), nullable=False)
@ -78,11 +79,11 @@ class Dpp(Thing):
""" """
id = Column(BigInteger, Sequence('device_seq'), primary_key=True) id = Column(BigInteger, Sequence('device_seq'), primary_key=True)
key = Column(Unicode(STR_SM_SIZE), nullable=False) key = Column(CIText(), nullable=False)
key.comment = "chid:phid, (chid it's in device and phid it's in the snapshot)" key.comment = "chid:phid, (chid it's in device and phid it's in the snapshot)"
documentId = Column(Unicode(STR_SM_SIZE), nullable=True) documentId = Column(CIText(), nullable=True)
documentId.comment = "is the hash of snapshot.json_wb" documentId.comment = "is the hash of snapshot.json_wb"
documentSignature = Column(Unicode(STR_SM_SIZE), nullable=True) documentSignature = Column(CIText(), nullable=True)
documentSignature.comment = "is the snapshot.json_wb with the signature of the user" documentSignature.comment = "is the snapshot.json_wb with the signature of the user"
timestamp = Column(BigInteger, nullable=False) timestamp = Column(BigInteger, nullable=False)