mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-12 01:11:24 +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
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class RepositoryTableStateUpdate < ActiveRecord::Migration[6.0]
|
class RepositoryTableStateUpdate < ActiveRecord::Migration[6.0]
|
||||||
|
class TempStateModel < ApplicationRecord
|
||||||
|
self.table_name = 'repository_table_states'
|
||||||
|
end
|
||||||
|
|
||||||
def up
|
def up
|
||||||
RepositoryTableState.all.each do |table_state|
|
TempStateModel.find_each do |table_state|
|
||||||
state = table_state.state
|
state = table_state.state
|
||||||
order_state = state['order'][0][0]
|
order_state = state['order'][0][0]
|
||||||
state['order'][0][0] = order_state + 2 if order_state > 5
|
state['order'][0][0] = order_state + 2 if order_state > 5
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue