aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'buildbot_gentoo_ci/db')
-rw-r--r--buildbot_gentoo_ci/db/model.py1
-rw-r--r--buildbot_gentoo_ci/db/versions.py6
2 files changed, 5 insertions, 2 deletions
diff --git a/buildbot_gentoo_ci/db/model.py b/buildbot_gentoo_ci/db/model.py
index b6a0c43..dea3e15 100644
--- a/buildbot_gentoo_ci/db/model.py
+++ b/buildbot_gentoo_ci/db/model.py
@@ -348,6 +348,7 @@ class Model(base.DBConnectorComponent):
nullable=False),
sa.Column('file_hash', sa.String(255), nullable=False),
sa.Column('commit_id', sa.String(255), nullable=False),
+ sa.Column('change_id', sa.Integer, nullable=True, default=0),
sa.Column('deleted', sa.Boolean, default=False),
sa.Column('deleted_at', sa.Integer, nullable=True),
)
diff --git a/buildbot_gentoo_ci/db/versions.py b/buildbot_gentoo_ci/db/versions.py
index 0aaac1b..8d35602 100644
--- a/buildbot_gentoo_ci/db/versions.py
+++ b/buildbot_gentoo_ci/db/versions.py
@@ -55,7 +55,7 @@ class VersionsConnectorComponent(base.DBConnectorComponent):
return res
@defer.inlineCallbacks
- def addVersion(self, name, package_uuid, file_hash, commit_id):
+ def addVersion(self, name, package_uuid, file_hash, commit_id, change_id):
def thd(conn, no_recurse=False):
try:
tbl = self.db.model.versions
@@ -63,7 +63,8 @@ class VersionsConnectorComponent(base.DBConnectorComponent):
r = conn.execute(q, dict(name=name,
package_uuid=package_uuid,
file_hash=file_hash,
- commit_id=commit_id))
+ commit_id=commit_id,
+ change_id=change_id))
except (sa.exc.IntegrityError, sa.exc.ProgrammingError):
uuid = None
else:
@@ -178,6 +179,7 @@ class VersionsConnectorComponent(base.DBConnectorComponent):
package_uuid=row.package_uuid,
file_hash=row.file_hash,
commit_id=row.commit_id,
+ change_id = row.change_id,
deleted=row.deleted,
deleted_at=row.deleted_at
)