Skip to content

Commit

Permalink
Merge pull request #491 from gyorb/pep8_dbmodel
Browse files Browse the repository at this point in the history
Clean pep8 warnings from db_model module
  • Loading branch information
Xazax-hun authored Jan 11, 2017
2 parents 43509a2 + 6e4634c commit 4ad350b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ addons:
postgresql: "9.3"

script:
- pep8 codechecker codechecker_lib tests
- pep8 codechecker codechecker_lib tests db_model

- ./change_clang_version.py

Expand Down
40 changes: 25 additions & 15 deletions db_model/orm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ class Config(Base):
__tablename__ = 'configs'

run_id = Column(Integer,
ForeignKey('runs.id', deferrable=True, initially="DEFERRED",
ondelete='CASCADE'), primary_key=True)
ForeignKey('runs.id', deferrable=True,
initially="DEFERRED", ondelete='CASCADE'),
primary_key=True)
checker_name = Column(String, primary_key=True)
attribute = Column(String, primary_key=True)
value = Column(String, primary_key=True)
Expand All @@ -95,8 +96,10 @@ class File(Base):

id = Column(Integer, autoincrement=True, primary_key=True)
run_id = Column(Integer,
ForeignKey('runs.id', deferrable=True, initially="DEFERRED",
ondelete='CASCADE'))
ForeignKey('runs.id', deferrable=True,
initially="DEFERRED",
ondelete='CASCADE')
)
filepath = Column(String)
content = Column(Binary)
inc_count = Column(Integer)
Expand All @@ -114,8 +117,9 @@ class BuildAction(Base):

id = Column(Integer, autoincrement=True, primary_key=True)
run_id = Column(Integer,
ForeignKey('runs.id', deferrable=True, initially="DEFERRED",
ondelete='CASCADE'))
ForeignKey('runs.id', deferrable=True,
initially="DEFERRED", ondelete='CASCADE')
)
build_cmd_hash = Column('build_cmd', String)
analyzer_type = Column(String, nullable=False)
analyzed_source_file = Column(String, nullable=False)
Expand Down Expand Up @@ -211,8 +215,10 @@ class Report(Base):
initially="DEFERRED",
ondelete='CASCADE'))
run_id = Column(Integer,
ForeignKey('runs.id', deferrable=True, initially="DEFERRED",
ondelete='CASCADE'), index=True)
ForeignKey('runs.id', deferrable=True,
initially="DEFERRED",
ondelete='CASCADE'),
index=True)
bug_id = Column(String, index=True)
checker_id = Column(String)
checker_cat = Column(String)
Expand Down Expand Up @@ -243,9 +249,9 @@ class Report(Base):
}

# Priority/severity etc...
def __init__(self, run_id, bug_id, file_id, checker_message, start_bugpoint,
start_bugevent, end_bugevent, checker_id, checker_cat,
bug_type, severity, suppressed):
def __init__(self, run_id, bug_id, file_id, checker_message,
start_bugpoint, start_bugevent, end_bugevent, checker_id,
checker_cat, bug_type, severity, suppressed):
self.run_id = run_id
self.file_id = file_id
self.bug_id = bug_id
Expand Down Expand Up @@ -284,8 +290,10 @@ class SuppressBug(Base):
hash = Column(String, nullable=False)
file_name = Column(String)
run_id = Column(Integer,
ForeignKey('runs.id', deferrable=True, initially="DEFERRED",
ondelete='CASCADE'), nullable=False)
ForeignKey('runs.id', deferrable=True,
initially="DEFERRED",
ondelete='CASCADE'),
nullable=False)
comment = Column(Binary)

def __init__(self, run_id, hash, file_name, comment):
Expand All @@ -300,8 +308,10 @@ class SkipPath(Base):
id = Column(Integer, autoincrement=True, primary_key=True)
path = Column(String)
run_id = Column(Integer,
ForeignKey('runs.id', deferrable=True, initially="DEFERRED",
ondelete='CASCADE'), nullable=False)
ForeignKey('runs.id', deferrable=True,
initially="DEFERRED",
ondelete='CASCADE'),
nullable=False)
comment = Column(Binary)

def __init__(self, run_id, path, comment):
Expand Down

0 comments on commit 4ad350b

Please sign in to comment.