class NEEMHubSettings(db.Model): """ DB model class for storing neem-hub configuration into postgresql. """ id = db.Column(db.Integer, primary_key=True) mongo_host = db.Column(db.String(255), nullable=False, default='134.102.137.85') mongo_port = db.Column(db.Integer(), default=28015) mongo_db = db.Column(db.String(255), nullable=False, default='neems') mongo_user = db.Column(db.String(255), nullable=False, default='') mongo_pass = db.Column(db.String(255), nullable=False, default='') urdf_server = db.Column( db.String(255), nullable=False, default='http://neem-1.informatik.uni-bremen.de/data/kinematics/') mesh_server = db.Column( db.String(255), nullable=False, default='http://neem-1.informatik.uni-bremen.de/data/') visibility_flag = db.Column(db.Boolean(), nullable=False, default=False)
class Role(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(50), unique=True)
import datetime from flask_user import UserMixin from app_and_db import app, db # Define the User-Roles pivot table user_roles = db.Table('user_roles', db.Column('id', db.Integer(), primary_key=True), db.Column('user_id', db.Integer(), db.ForeignKey('user.id', ondelete='CASCADE')), db.Column('role_id', db.Integer(), db.ForeignKey('role.id', ondelete='CASCADE'))) class Role(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(50), unique=True) class NEEMLike(db.Model): __tablename__ = 'neem_like' id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey('user.id')) neem_id = db.Column(db.String(50), nullable=False) class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) active = db.Column(db.Boolean(), nullable=False, default=False) username = db.Column(db.String(50), nullable=False, unique=True) displayname = db.Column(db.String(50), nullable=False, default='') remoteapp = db.Column(db.String(50), nullable=False, default='') # TODO(daniel): unused
class UserRoles(db.Model): id = db.Column(db.Integer(), primary_key=True) user_id = db.Column(db.Integer(), db.ForeignKey('user.id', ondelete='CASCADE')) role_id = db.Column(db.Integer(), db.ForeignKey('role.id', ondelete='CASCADE'))