mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-26 14:06:23 +08:00
Fix step and result text name migration [SCI-9141] (#6154)
This commit is contained in:
parent
38e62c9835
commit
8cecdd86ea
1 changed files with 16 additions and 3 deletions
|
|
@ -1,8 +1,21 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require File.expand_path('app/helpers/database_helper')
|
||||
|
||||
class AddNameColumnToTextComponent < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :result_texts, :name, :string, default: '', index: true
|
||||
add_column :step_texts, :name, :string, default: '', index: true
|
||||
include DatabaseHelper
|
||||
|
||||
def up
|
||||
add_column :result_texts, :name, :string
|
||||
add_column :step_texts, :name, :string
|
||||
add_gist_index :result_texts, :name
|
||||
add_gist_index :step_texts, :name
|
||||
end
|
||||
|
||||
def down
|
||||
remove_index :step_texts, :name
|
||||
remove_index :result_texts, :name
|
||||
remove_column :step_texts, :name
|
||||
remove_column :result_texts, :name
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue