summaryrefslogtreecommitdiff
path: root/db/migrate/20260705152316_add_default_template_name_to_nodes.rb
blob: ec2d8eafd4fefdaeef715a43c1d208d4addeeb1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
class AddDefaultTemplateNameToNodes < ActiveRecord::Migration[8.1]
  def up
    add_column :nodes, :default_template_name, :string

    Node.find_each do |node|
      node.update_column(:default_template_name, "update") if node.update?
    end
  end

  def down
    remove_column :nodes, :default_template_name
  end
end