mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 13:38:18 -08:00
Calculate benchmarks for measures based on a weighted average of survey and admin data items Added architectural records
11 lines
321 B
Ruby
11 lines
321 B
Ruby
class AddSlugToDistrict < ActiveRecord::Migration[5.0]
|
|
def up
|
|
add_column :districts, :slug, :string
|
|
add_index :districts, :slug, unique: true
|
|
District.all.each { |district| district.update(slug: district.slug ||= district.name.parameterize) }
|
|
end
|
|
|
|
def down
|
|
remove_column :districts, :slug
|
|
end
|
|
end
|