|
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # Copyright Buildbot Team Members
# older build masters stored some of their state with an object named # 'master' with class 'buildbot.master.BuildMaster', while other state was # stored with objects named after each master itself, with class # BuildMaster.
# get the old, unwanted ID whereclause=(objects_table.c.name=='master') & (objects_table.c.class_name == 'buildbot.master.BuildMaster'))
# if there's no such ID, there's nothing to change
# get the new ID whereclause=objects_table.c.class_name == 'BuildMaster')
# if there is exactly one ID, update the existing object_states. If # there are zero or multiple object_states, then we do not know which # master to assign last_processed_change to, so we just delete it. # This indicates to the master that it has processed all changes, which # is probably accurate.
# update rows with the old id to use the new id whereclause=(object_state_table.c.objectid == old_id)) else: whereclause=(object_state_table.c.objectid == old_id))
# in either case, delete the old object row whereclause=(objects_table.c.id == old_id))
# and update the class name for the new rows whereclause=(objects_table.c.class_name == 'BuildMaster')) |