-class SeparateRepositoryFromScriptVersion < ActiveRecord::Migration
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+class SeparateRepositoryFromScriptVersion < ActiveRecord::Migration[4.2]
include CurrentApiClient
def fixup pt
c = pt.components
c.each do |k, v|
commit_ish = v["script_version"]
- if commit_ish.index(':')
+ if commit_ish.andand.index(':')
want_repo, commit_ish = commit_ish.split(':',2)
v[:repository] = want_repo
v[:script_version] = commit_ish