2016-10-25 18:45:05 +02:00
|
|
|
class CreateSearches < ActiveRecord::Migration
|
|
|
|
def up
|
2016-10-28 19:34:29 +02:00
|
|
|
add_index :champs, :dossier_id
|
|
|
|
add_index :champs, :type_de_champ_id
|
|
|
|
add_index :drop_down_lists, :type_de_champ_id
|
|
|
|
add_index :etablissements, :dossier_id
|
|
|
|
add_index :entreprises, :dossier_id
|
|
|
|
add_index :france_connect_informations, :user_id
|
|
|
|
add_index :individuals, :dossier_id
|
|
|
|
add_index :pieces_justificatives, :dossier_id
|
|
|
|
add_index :rna_informations, :entreprise_id
|
2017-02-14 18:20:40 +01:00
|
|
|
create_view :searches unless Rails.env.test? #, materialized: true
|
2016-10-25 18:45:05 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2016-10-28 19:34:29 +02:00
|
|
|
remove_index :champs, :dossier_id
|
|
|
|
remove_index :champs, :type_de_champ_id
|
|
|
|
remove_index :drop_down_lists, :type_de_champ_id
|
|
|
|
remove_index :etablissements, :dossier_id
|
|
|
|
remove_index :entreprises, :dossier_id
|
|
|
|
remove_index :france_connect_informations, :user_id
|
|
|
|
remove_index :individuals, :dossier_id
|
|
|
|
remove_index :pieces_justificatives, :dossier_id
|
|
|
|
remove_index :rna_informations, :entreprise_id
|
2017-02-14 18:20:40 +01:00
|
|
|
drop_view :searches unless Rails.env.test? #, materialized: true
|
2016-10-25 18:45:05 +02:00
|
|
|
end
|
|
|
|
end
|