Files
velour/db/migrate/20251029120428_update_works_from_architecture.rb
Dan Milne 88a906064f
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled
Much base work started
2025-10-31 14:36:14 +11:00

17 lines
433 B
Ruby

class UpdateWorksFromArchitecture < ActiveRecord::Migration[8.1]
def change
change_table :works do |t|
# Add defaults for boolean fields
t.change_default :organized, false
# Make title required
t.change_null :title, false
end
# Add indexes as specified in architecture
add_index :works, :title
add_index :works, [:title, :year], unique: true
add_index :works, :organized
end
end