Update migration

This commit is contained in:
aignatov-bio 2020-06-24 09:51:24 +02:00
parent 0fe4ee0eae
commit 0dff84cae0

View file

@ -1,8 +1,12 @@
# frozen_string_literal: true
class RepositoryTableStateUpdate < ActiveRecord::Migration[6.0]
class TempStateModel < ApplicationRecord
self.table_name = 'repository_table_states'
end
def up
RepositoryTableState.all.each do |table_state|
TempStateModel.find_each do |table_state|
state = table_state.state
order_state = state['order'][0][0]
state['order'][0][0] = order_state + 2 if order_state > 5