scinote-web/db/migrate/20230904080206_add_name_column_to_text_component.rb

22 lines
533 B
Ruby
Raw Normal View History

2023-09-04 19:58:11 +08:00
# frozen_string_literal: true
require File.expand_path('app/helpers/database_helper')
2023-09-04 19:58:11 +08:00
class AddNameColumnToTextComponent < ActiveRecord::Migration[7.0]
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
2023-09-04 19:58:11 +08:00
end
end