mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-27 10:08:11 +08:00
Update migration
This commit is contained in:
parent
0fe4ee0eae
commit
0dff84cae0
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue