예제 #1
0
class Collections(_Base):
    """Table mapping (user_id, collection_name) => collection_id.

    This table provides a per-user namespace for custom collection names.
    It maps a (user_id, collection_name) pair to a unique collection id.
    """
    __tablename__ = 'collections'
    # XXX add indexes
    userid = Column(Integer, primary_key=True, nullable=False)
    collectionid = Column(Integer, primary_key=True, nullable=False)
    name = Column(String(32), nullable=False)
예제 #2
0
파일: sql.py 프로젝트: almet/wimms
        class UserNodes(base):
            """This table lists all the users associated to a service.

            A user is represented by an email, a uid and its allocated node.
            """
            __tablename__ = 'user_nodes'
            email = Column(String(128), primary_key=True, index=True)
            node = Column(String(64), primary_key=True, nullable=False)
            service = Column(String(30))
            uid = Column(BigInteger(),
                         index=True,
                         autoincrement=True,
                         unique=True,
                         nullable=False)
예제 #3
0
class _WBOBase(object):
    """Column definitions for sharded WBO storage.

    This mixin class defines the columns used for storage of WBO records.
    It is used to create either sharded or non-shareded WBO storage tables,
    depending on the run-time settings of the application.
    """
    id = Column(String(64), primary_key=True, autoincrement=False)
    username = Column(Integer, primary_key=True, nullable=False)
    collection = Column(Integer, primary_key=True, nullable=False, default=0)
    parentid = Column(String(64))
    predecessorid = Column(String(64))
    sortindex = Column(Integer)
    modified = Column(BigInteger)
    payload = Column(Text)
    payload_size = Column(Integer, nullable=False, default=0)
    ttl = Column(Integer, default=MAX_TTL)
class Users(_Base):
    __tablename__ = 'users'
    __table_args__ = (UniqueConstraint('username', 'password_hash'), {})

    id = Column(Integer, primary_key=True, nullable=False)
    username = Column(String(32))
    password_hash = Column(String(128))
    email = Column(String(64))
    status = Column(Integer, default=0)
    alert = Column(Text)
    reset = Column(String(32))
    reset_expiration = Column(DateTime())
예제 #5
0
파일: sql.py 프로젝트: almet/wimms
class _NodesBase(object):
    """A Table that keep tracks of all nodes per service
    """
    service = Column(String(30), primary_key=True, nullable=False)
    node = Column(String(64), primary_key=True, nullable=False)
    available = Column(Integer(11), default=0, nullable=False)
    current_load = Column(Integer(11), default=0, nullable=False)
    capacity = Column(Integer(11), default=0, nullable=False)
    downed = Column(Integer(6), default=0, nullable=False)
    backoff = Column(Integer(11), default=0, nullable=False)
class Users(_Base):
    __tablename__ = 'user'

    userid = Column(Integer, primary_key=True, nullable=False)
    username = Column(String(32), unique=True, nullable=False)
    password = Column(String(128))
    accountStatus = Column(Integer, default=1, server_default=sqltext('1'))
    mail = Column(String(64))
    mailVerified = Column(Integer, default=0, server_default=sqltext('0'))
    syncNode = Column(String(64))
class Application(_Base):
    __tablename__ = 'applications'

    id = Column(Integer, primary_key=True)
    user = Column(String(256), nullable=False)
    collection = Column(String(256), nullable=False)
    origin = Column(String(256), nullable=False)
    last_modified = Column(BigInteger, nullable=False)
    data = Column(Text)
예제 #8
0
class KeyStorage(SQLBase):
    __tablename__ = 'velruse_key_storage'
    key = Column(String(200), primary_key=True, nullable=False)
    value = Column(Text(), nullable=False)
    expires = Column(DateTime())
class UserIds(_Base):
    __tablename__ = 'user_ids'

    id = Column(Integer, primary_key=True, autoincrement=True)
class Collection(_Base):
    __tablename__ = 'collections'
    id = Column(Integer, primary_key=True)
    uuid = Column(String(256), nullable=False)
    user = Column(String(256), nullable=False)
    collection = Column(String(256), nullable=False)
class ResetCodes(_Base):
    __tablename__ = 'reset_codes'

    username = Column(String(32), primary_key=True, nullable=False)
    reset = Column(String(32))
    expiration = Column(DateTime())
class Users(_Base):
    __tablename__ = 'users'

    id = Column(Integer, primary_key=True)
    name = Column(String(256), nullable=False)