ensl.org/db/migrate/20200331020637_add_title_to_directories.rb
Ari Timonen 6bcfffa1ee Major update, bugfixes
- Use ruby 2.7.7 as it fixed startup issues
- Update gems
- Remove depr. from puma startup
- Make entry.sh dir-agnostic

Fix tests:
- Use apparition
- Update migrations to use new syntax
- Some other minor changes
2023-02-19 17:08:46 +02:00

12 lines
278 B
Ruby

class AddTitleToDirectories < ActiveRecord::Migration[4.2][6.0]
def change
change_table :directories do |m|
m.string :title
end
Directory.all.each do |dir|
dir.title = dir.name
dir.name = File.basename(dir.path)
dir.save!
end
end
end