예제 #1
0
파일: models.py 프로젝트: tufei8438/mercury
class Session(BaseModel):

    __tablename__ = 'session'

    id = db.Column(db.String(64), primary_key=True)
    usercode = db.Column(db.String(16), nullable=False)
    expire_at = db.Column(db.DateTime, nullable=False)
예제 #2
0
파일: models.py 프로젝트: tufei8438/mercury
class Role(BaseModel):

    __tablename__ = 'role'

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(32),
                     nullable=False,
                     server_default=db.text("''"))
예제 #3
0
파일: models.py 프로젝트: tufei8438/mercury
class DepartmentUser(BaseModel):

    __tablename__ = 'department_user'

    id = db.Column(db.Integer, primary_key=True)
    department_id = db.Column(db.Integer)
    usercode = db.Column(db.String(16))
    title = db.Column(db.String(64))
예제 #4
0
파일: models.py 프로젝트: tufei8438/mercury
class Permission(BaseModel):

    __tablename__ = 'permission'

    id = db.Column(db.Integer, primary_key=True)
    parent_id = db.Column(db.Integer,
                          nullable=False,
                          server_default=db.text("'0'"))
    code = db.Column(db.String(32),
                     nullable=False,
                     server_default=db.text("''"))
    type = db.Column(db.Integer, nullable=False, server_default=db.text("'1'"))
    name = db.Column(db.String(32),
                     nullable=False,
                     server_default=db.text("''"))
예제 #5
0
파일: models.py 프로젝트: tufei8438/mercury
class Grid(BaseModel):

    __tablename__ = 'grid'

    id = db.Column(db.Integer, primary_key=True)
    code = db.Column(db.String(32),
                     nullable=False,
                     unique=True,
                     server_default=db.text("''"))
    usercode = db.Column(db.String(16), server_default=db.text("''"))
    status = db.Column(db.Integer)
    update_time = db.Column(
        db.DateTime,
        nullable=False,
        server_default=db.text(
            "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
예제 #6
0
파일: models.py 프로젝트: tufei8438/mercury
class RolePermission(BaseModel):

    __tablename__ = 'role_permission'

    id = db.Column(db.Integer, primary_key=True)
    role_id = db.Column(db.ForeignKey('role.id',
                                      ondelete='CASCADE',
                                      onupdate='CASCADE'),
                        nullable=False,
                        index=True)
    permission_id = db.Column(db.ForeignKey('permission.id',
                                            ondelete='CASCADE',
                                            onupdate='CASCADE'),
                              nullable=False,
                              index=True)
    role = db.relationship('Role')
    user = db.relationship('Permission')
예제 #7
0
파일: models.py 프로젝트: tufei8438/mercury
class RoleUser(BaseModel):

    __tablename__ = 'role_user'

    id = db.Column(db.Integer, primary_key=True)
    role_id = db.Column(db.ForeignKey('role.id',
                                      ondelete='CASCADE',
                                      onupdate='CASCADE'),
                        nullable=False,
                        index=True)
    usercode = db.Column(db.ForeignKey('user.usercode',
                                       ondelete='CASCADE',
                                       onupdate='CASCADE'),
                         nullable=False,
                         index=True,
                         server_default=db.text("''"))

    role = db.relationship('Role')
    user = db.relationship('User')
예제 #8
0
파일: models.py 프로젝트: tufei8438/mercury
class Category(BaseModel):

    __tablename__ = 'category'

    id = db.Column(db.Integer, primary_key=True)
    type = db.Column(db.Integer, nullable=False, server_default=db.text("'1'"))
    parent_id = db.Column(db.Integer,
                          nullable=False,
                          server_default=db.text("'0'"))
    parent_code = db.Column(db.String(4))
    code = db.Column(db.String(4),
                     nullable=False,
                     server_default=db.text("''"))
    longcode = db.Column(db.String(4),
                         nullable=False,
                         server_default=db.text("''"))
    name = db.Column(db.String(64),
                     nullable=False,
                     server_default=db.text("''"))
    description = db.Column(db.String(256))
    icon = db.Column(db.String(256))
    order = db.Column(db.Integer,
                      nullable=False,
                      server_default=db.text("'1'"))
예제 #9
0
파일: models.py 프로젝트: tufei8438/mercury
class Department(BaseModel):

    __tablename__ = 'department'

    id = db.Column(db.Integer, primary_key=True)
    parent_id = db.Column(db.Integer,
                          nullable=False,
                          server_default=db.text("'0'"))
    code = db.Column(db.String(32),
                     nullable=False,
                     unique=True,
                     server_default=db.text("''"))
    type = db.Column(db.Integer)
    name = db.Column(db.String(64))
    region_id = db.Column(db.Integer, nullable=False)
    description = db.Column(db.String(512))
    status = db.Column(db.Integer,
                       nullable=False,
                       server_default=db.text("'1'"))
    create_time = db.Column(db.DateTime,
                            nullable=False,
                            server_default=db.text("CURRENT_TIMESTAMP"))
예제 #10
0
파일: models.py 프로젝트: tufei8438/mercury
class Sequence(BaseModel):

    __tablename__ = 'sequence'

    id = db.Column(db.String(64), primary_key=True)
    name = db.Column(db.String(16), nullable=False)
    current = db.Column(db.Integer,
                        nullable=False,
                        server_default=db.text("'1'"))
    min = db.Column(db.Integer, nullable=False, server_default=db.text("'1'"))
    max = db.Column(db.Integer,
                    nullable=False,
                    server_default=db.text("'99999999'"))
    step = db.Column(db.Integer, nullable=False, server_default=db.text("'1'"))
    description = db.Column(db.String(256))
예제 #11
0
파일: models.py 프로젝트: tufei8438/mercury
class Attachment(BaseModel):

    __tablename__ = 'attachment'

    id = db.Column(db.Integer, primary_key=True)
    attach_type = db.Column(db.Integer)
    attach_id = db.Column(db.Integer)
    media_type = db.Column(db.Integer)
    media_path = db.Column(db.String(256))
    create_time = db.Column(db.DateTime,
                            nullable=False,
                            server_default=db.text("CURRENT_TIMESTAMP"))
예제 #12
0
파일: models.py 프로젝트: tufei8438/mercury
class Region(BaseModel):

    __tablename__ = 'region'

    id = db.Column(db.Integer, primary_key=True)
    parent_id = db.Column(db.Integer, nullable=False)
    name = db.Column(db.String(32),
                     nullable=False,
                     server_default=db.text("''"))
    level = db.Column(db.Integer, nullable=False)
    code = db.Column(db.String(32),
                     nullable=False,
                     server_default=db.text("''"))
    longcode = db.Column(db.String(32),
                         nullable=False,
                         server_default=db.text("''"))
    order = db.Column(db.Integer, nullable=False)
예제 #13
0
파일: models.py 프로젝트: tufei8438/mercury
class User(BaseModel):

    __tablename__ = 'user'

    usercode = db.Column(db.String(16),
                         nullable=False,
                         primary_key=True,
                         server_default=db.text("''"))
    user_type = db.Column(db.Integer,
                          nullable=False,
                          server_default=db.text("'1'"))
    name = db.Column(db.String(32),
                     nullable=False,
                     server_default=db.text("''"))
    phone = db.Column(db.String(16))
    status = db.Column(db.Integer,
                       nullable=False,
                       server_default=db.text("'1'"))
    update_time = db.Column(db.DateTime)
    create_time = db.Column(db.DateTime,
                            nullable=False,
                            server_default=db.text("'0000-00-00 00:00:00'"))
예제 #14
0
파일: models.py 프로젝트: tufei8438/mercury
class Event(BaseModel):

    __tablename__ = 'event'

    id = db.Column(db.Integer, primary_key=True)
    code = db.Column(db.String(32),
                     nullable=False,
                     unique=True,
                     server_default=db.text("''"))
    name = db.Column(db.String(64),
                     nullable=False,
                     server_default=db.text("''"))
    region_id = db.Column(db.Integer, nullable=False)
    dept_id = db.Column(db.Integer)
    update_time = db.Column(
        db.DateTime,
        nullable=False,
        server_default=db.text(
            "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
예제 #15
0
파일: models.py 프로젝트: tufei8438/mercury
class Component(BaseModel):

    __tablename__ = 'component'

    id = db.Column(db.Integer, primary_key=True)
    code = db.Column(db.String(32),
                     nullable=False,
                     server_default=db.text("''"))
    name = db.Column(db.String(64),
                     nullable=False,
                     server_default=db.text("''"))
    longitude = db.Column(db.String(64))
    latitude = db.Column(db.String(64))
    address = db.Column(db.String(256))
    grid_code = db.Column(db.String(32),
                          nullable=False,
                          server_default=db.text("''"))
    description = db.Column(db.String(128))
    status = db.Column(db.Integer,
                       nullable=False,
                       server_default=db.text("'1'"))
    collect_time = db.Column(db.DateTime)
    collect_user = db.Column(db.String(32))
    collect_dept_id = db.Column(db.Integer)
    verify_time = db.Column(db.DateTime)
    verify_user = db.Column(db.String(32))
    verify_dept_id = db.Column(db.Integer)
    manage_dept_id = db.Column(db.Integer)
    owner_dept_id = db.Column(db.Integer)
    maintain_dept_id = db.Column(db.Integer)
    update_time = db.Column(db.DateTime, nullable=False)
예제 #16
0
파일: models.py 프로젝트: tufei8438/mercury
class Case(BaseModel):

    __tablename__ = 'case'

    id = db.Column(db.Integer, primary_key=True)
    code = db.Column(db.String(32),
                     nullable=False,
                     unique=True,
                     server_default=db.text("''"))
    source = db.Column(db.Integer,
                       nullable=False,
                       server_default=db.text("'1'"))
    name = db.Column(db.String(128),
                     nullable=False,
                     server_default=db.text("''"))
    category_type = db.Column(db.Integer,
                              nullable=False,
                              server_default=db.text("'1'"))
    parent_category_code = db.Column(db.String(4),
                                     nullable=False,
                                     server_default=db.text("''"))
    parent_category_name = db.Column(db.String(64),
                                     nullable=False,
                                     server_default=db.text("''"))
    category_code = db.Column(db.String(4),
                              nullable=False,
                              server_default=db.text("''"))
    category_name = db.Column(db.String(64),
                              nullable=False,
                              server_default=db.text("''"))
    description = db.Column(db.String(512))
    address = db.Column(db.String(512))
    longitude = db.Column(db.String(64))
    latitude = db.Column(db.String(64))
    grid_code = db.Column(db.String(64))
    obj_code = db.Column(db.String(64))
    reporter_usercode = db.Column(db.String(32))
    reporter_name = db.Column(db.String(64))
    reporter_phone = db.Column(db.String(16))
    reporter_address = db.Column(db.String(256))
    proc_inst_id = db.Column(db.String(64))
    begin_time = db.Column(db.DateTime, default=func.now())
    end_time = db.Column(db.DateTime)
    expect_end_time = db.Column(db.DateTime)
    status = db.Column(db.Integer,
                       nullable=False,
                       server_default=db.text("'1'"))
    priority = db.Column(db.Integer,
                         nullable=False,
                         server_default=db.text("'1'"))
예제 #17
0
파일: models.py 프로젝트: tufei8438/mercury
class CaseActivity(BaseModel):

    __tablename__ = 'case_activity'

    id = db.Column(db.Integer, primary_key=True)
    case_id = db.Column(db.Integer, nullable=False, index=True)
    task_id = db.Column(db.String(64),
                        nullable=False,
                        server_default=db.text("''"))
    name = db.Column(db.String(64))
    usercode = db.Column(db.String(32))
    status = db.Column(db.Integer)
    description = db.Column(db.String(512))
    begin_time = db.Column(db.DateTime)
    end_time = db.Column(db.DateTime)
    expect_end_time = db.Column(db.DateTime)
    remark = db.Column(db.String(128))