Skip to content

Commit

Permalink
[api] avoid updateinfo counter per patch name
Browse files Browse the repository at this point in the history
Do this just as a hack for now until we validated that we want this.
Then drop also the DB column.
  • Loading branch information
adrianschroeter committed Jun 25, 2015
1 parent 7103faf commit bdfea20
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/api/app/models/maintenance_incident.rb
Expand Up @@ -62,14 +62,15 @@ def initUpdateinfoId(template = "%Y-%C", patch_name = nil)
counterType << " AND ISNULL(day) "
day = nil
end
if template =~ /%N/
name = (self.name||"")
counterType << " AND name = ? "
values << name
else
# FIXME: temporary disabled for validation, clean up including db migration later
# if template =~ /%N/
# name = (self.name||"")
# counterType << " AND name = ? "
# values << name
# else
counterType << " AND ISNULL(name) "
name = nil
end
# end

r = MaintenanceIncident.exec_query(["SELECT counter FROM updateinfo_counter WHERE maintenance_db_project_id = ? #{counterType} FOR UPDATE",
self.maintenance_db_project_id,*values]).first
Expand Down

0 comments on commit bdfea20

Please sign in to comment.