demarches-normaliennes/db/migrate/20220725090224_add_etablissement_infos_to_services.rb

17 lines
560 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class AddEtablissementInfosToServices < ActiveRecord::Migration[6.1]
def up
add_column :services, :etablissement_infos, :jsonb
add_column :services, :etablissement_lat, :decimal, precision: 10, scale: 6
add_column :services, :etablissement_lng, :decimal, precision: 10, scale: 6
change_column_default :services, :etablissement_infos, {}
end
def down
remove_column :services, :etablissement_infos
remove_column :services, :etablissement_lat
remove_column :services, :etablissement_lng
end
end