class Install(db.Model): __tablename__ = dbtableprefix + "install" id = db.Column(db.Integer(), primary_key=True, unique=True) hostname = db.Column(db.Text()) version = db.Column(db.Integer()) packageversion = db.Column(db.Text()) package_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'package.id', ondelete='CASCADE'))
class UserDictKeys(db.Model): __tablename__ = dbtableprefix + "userdictkeys" indexno = db.Column(db.Integer(), primary_key=True) filename = db.Column(db.String(255), index=True) key = db.Column(db.String(250), index=True) user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE'), index=True) temp_user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'tempuser.id', ondelete='CASCADE'), index=True)
class GlobalObjectStorage(db.Model): __tablename__ = dbtableprefix + "globalobjectstorage" id = db.Column(db.Integer(), primary_key=True, unique=True) key = db.Column(db.String(1024), index=True) value = db.Column(db.Text()) encrypted = db.Column(db.Boolean(), nullable=False, server_default=true()) user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE')) temp_user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'tempuser.id', ondelete='CASCADE'))
class EmailAttachment(db.Model): __tablename__ = dbtableprefix + "emailattachment" id = db.Column(db.Integer(), primary_key=True, unique=True) email_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'email.id', ondelete='CASCADE')) index = db.Column(db.Integer()) content_type = db.Column(db.Text()) extension = db.Column(db.Text()) upload = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'uploads.indexno', ondelete='CASCADE'))
class Attachments(db.Model): __tablename__ = dbtableprefix + "attachments" id = db.Column(db.Integer(), primary_key=True) key = db.Column(db.String(250)) dictionary = db.Column(db.Text()) question = db.Column(db.Integer()) filename = db.Column(db.Text()) encrypted = db.Column(db.Boolean(), nullable=False, server_default='1')
class UserDict(db.Model): __tablename__ = dbtableprefix + "userdict" indexno = db.Column(db.Integer(), primary_key=True) filename = db.Column(db.String(255), index=True) key = db.Column(db.String(250), index=True) dictionary = db.Column(db.Text()) user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE')) encrypted = db.Column(db.Boolean(), nullable=False, server_default='1') modtime = db.Column(db.DateTime())
class UserRoles(db.Model): __tablename__ = dbtableprefix + 'user_roles' id = db.Column(db.Integer(), primary_key=True) user_id = db.Column( db.Integer(), db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE')) role_id = db.Column( db.Integer(), db.ForeignKey(dbtableprefix + 'role.id', ondelete='CASCADE'))
class PackageAuth(db.Model): __tablename__ = dbtableprefix + 'package_auth' id = db.Column(db.Integer, primary_key=True) package_id = db.Column( db.Integer(), db.ForeignKey(dbtableprefix + 'package.id', ondelete='CASCADE')) user_id = db.Column( db.Integer(), db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE')) authtype = db.Column(db.String(255), server_default='owner')
class Shortener(db.Model): __tablename__ = dbtableprefix + "shortener" id = db.Column(db.Integer(), primary_key=True, unique=True) short = db.Column(db.String(250), nullable=False, unique=True) filename = db.Column(db.String(255), index=True) uid = db.Column(db.String(250)) user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE')) temp_user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'tempuser.id', ondelete='CASCADE')) key = db.Column(db.String(255), index=True) index = db.Column(db.Integer()) modtime = db.Column(db.DateTime(), server_default=db.func.now())
class SpeakList(db.Model): __tablename__ = dbtableprefix + "speaklist" id = db.Column(db.Integer(), primary_key=True, unique=True) filename = db.Column(db.String(255), index=True) key = db.Column(db.String(250), index=True) phrase = db.Column(db.Text()) question = db.Column(db.Integer()) type = db.Column(db.String(20)) language = db.Column(db.String(10)) dialect = db.Column(db.String(10)) upload = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'uploads.indexno', ondelete='CASCADE')) encrypted = db.Column(db.Boolean(), nullable=False, server_default=true()) digest = db.Column(db.Text())
class ChatLog(db.Model): __tablename__ = dbtableprefix + "chatlog" id = db.Column(db.Integer(), primary_key=True, unique=True) filename = db.Column(db.String(255), index=True) key = db.Column(db.String(250), index=True) message = db.Column(db.Text()) user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE')) temp_user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'tempuser.id', ondelete='CASCADE')) owner_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE')) temp_owner_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'tempuser.id', ondelete='CASCADE')) open_to_peer = db.Column(db.Boolean(), nullable=False, server_default='0') encrypted = db.Column(db.Boolean(), nullable=False, server_default='1') modtime = db.Column(db.DateTime())
class UploadsRoleAuth(db.Model): __tablename__ = dbtableprefix + "uploadsroleauth" id = db.Column(db.Integer(), primary_key=True) uploads_indexno = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'uploads.indexno', ondelete='CASCADE'), nullable=False, index=True) role_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'role.id', ondelete='CASCADE'), nullable=False, index=True)
class Package(db.Model): __tablename__ = dbtableprefix + 'package' id = db.Column(db.Integer, primary_key=True, unique=True) name = db.Column(db.String(255), nullable=False) type = db.Column(db.Text()) #github, zip, pip giturl = db.Column(db.String(255), nullable=True) gitsubdir = db.Column(db.Text(), nullable=True) upload = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'uploads.indexno', ondelete='CASCADE')) package_auth = db.relationship('PackageAuth', uselist=False, primaryjoin="PackageAuth.package_id==Package.id") version = db.Column(db.Integer(), server_default='1') packageversion = db.Column(db.Text()) limitation = db.Column(db.Text()) dependency = db.Column(db.Boolean(), nullable=False, server_default='0') core = db.Column(db.Boolean(), nullable=False, server_default='0') active = db.Column(db.Boolean(), nullable=False, server_default='1') gitbranch = db.Column(db.String(255), nullable=True)
class Supervisors(db.Model): __tablename__ = dbtableprefix + "supervisors" id = db.Column(db.Integer(), primary_key=True) hostname = db.Column(db.Text()) url = db.Column(db.Text()) start_time = db.Column(db.DateTime(), server_default=db.func.now()) role = db.Column(db.Text())
class UserAuthModel(db.Model, UserMixin): __tablename__ = dbtableprefix + 'user_auth' id = db.Column(db.Integer, primary_key=True, unique=True) user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE'), index=True) password = db.Column(db.String(255), nullable=False, server_default='') reset_password_token = db.Column(db.String(100), nullable=False, server_default='') #active = db.Column(db.Boolean(), nullable=False, server_default='0') user = db.relationship('UserModel', uselist=False, primaryjoin="UserModel.id==UserAuthModel.user_id", back_populates="user_auth")
class Uploads(db.Model): __tablename__ = dbtableprefix + "uploads" indexno = db.Column(db.Integer(), primary_key=True, unique=True) key = db.Column(db.String(250), index=True) filename = db.Column(db.String(255), index=True) yamlfile = db.Column(db.String(255), index=True) private = db.Column(db.Boolean(), nullable=False, server_default=true()) persistent = db.Column(db.Boolean(), nullable=False, server_default=false())
class UploadsUserAuth(db.Model): __tablename__ = dbtableprefix + "uploadsuserauth" id = db.Column(db.Integer(), primary_key=True) uploads_indexno = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'uploads.indexno', ondelete='CASCADE'), nullable=False, index=True) user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE'), index=True) temp_user_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'tempuser.id', ondelete='CASCADE'), index=True)
class MyUserInvitation(db.Model): __tablename__ = dbtableprefix + 'user_invite' id = db.Column(db.Integer, primary_key=True, unique=True) email = db.Column(db.String(255), nullable=False) role_id = db.Column(db.Integer(), db.ForeignKey(dbtableprefix + 'role.id', ondelete='CASCADE')) # save the user of the invitee invited_by_user_id = db.Column(db.Integer, db.ForeignKey(dbtableprefix + 'user.id')) # token used for registration page to identify user registering token = db.Column(db.String(100), nullable=False, server_default='')
class MachineLearning(db.Model): __tablename__ = dbtableprefix + "machinelearning" id = db.Column(db.Integer(), primary_key=True) group_id = db.Column(db.Text()) key = db.Column(db.Text()) independent = db.Column(db.Text()) dependent = db.Column(db.Text()) create_time = db.Column(db.DateTime()) modtime = db.Column(db.DateTime()) active = db.Column(db.Boolean(), nullable=False, server_default='0')
class JsonStorage(db.Model): __tablename__ = dbtableprefix + "jsonstorage" id = db.Column(db.Integer(), primary_key=True, unique=True) filename = db.Column(db.String(255), index=True) key = db.Column(db.String(250), index=True) if dbprefix.startswith('postgresql'): data = db.Column(JSONB) else: data = db.Column(db.Text()) tags = db.Column(db.Text()) modtime = db.Column(db.DateTime(), server_default=db.func.now()) persistent = db.Column(db.Boolean(), nullable=False, server_default=false())
class Email(db.Model): __tablename__ = dbtableprefix + "email" id = db.Column(db.Integer(), primary_key=True, unique=True) short = db.Column(db.String(250), db.ForeignKey(dbtableprefix + 'shortener.short', ondelete='CASCADE')) all_addr = db.Column(db.Text()) to_addr = db.Column(db.Text()) cc_addr = db.Column(db.Text()) from_addr = db.Column(db.Text()) reply_to_addr = db.Column(db.Text()) return_path_addr = db.Column(db.Text()) subject = db.Column(db.Text()) datetime_message = db.Column(db.DateTime()) datetime_received = db.Column(db.DateTime())
class ObjectStorage(db.Model): __tablename__ = dbtableprefix + "objectstorage" id = db.Column(db.Integer(), primary_key=True, unique=True) key = db.Column(db.String(1024), index=True) value = db.Column(db.Text())
class ObjectStorage(db.Model): __tablename__ = dbtableprefix + "objectstorage" id = db.Column(db.Integer(), primary_key=True) key = db.Column(db.Text()) value = db.Column(db.Text())
class Uploads(db.Model): __tablename__ = dbtableprefix + "uploads" indexno = db.Column(db.Integer(), primary_key=True) key = db.Column(db.String(250)) filename = db.Column(db.Text()) yamlfile = db.Column(db.Text())
class Role(db.Model): __tablename__ = dbtableprefix + 'role' id = db.Column(db.Integer(), primary_key=True, unique=True) name = db.Column(db.String(50), unique=True, index=True) description = db.Column(db.String(255))