diff options
| author | Zog | 2018-03-07 07:50:02 +0100 | 
|---|---|---|
| committer | Zog | 2018-03-12 12:00:13 +0100 | 
| commit | b810deb08cadd56caeb76eb81cff363458bb79a3 (patch) | |
| tree | 6fd0c1bc383a9fa501666f6d86cee2ec06c573cd /db | |
| parent | 7b53b4c86d0469c21b54f4f974fbae5fc205ed0f (diff) | |
| download | chouette-core-b810deb08cadd56caeb76eb81cff363458bb79a3.tar.bz2 | |
Refs #6133; Fix specs
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20171106111448_update_import_message_criticity_type_to_string.rb | 4 | ||||
| -rw-r--r-- | db/migrate/20180306152953_update_imports_names.rb | 8 | ||||
| -rw-r--r-- | db/schema.rb | 9 | 
3 files changed, 13 insertions, 8 deletions
| diff --git a/db/migrate/20171106111448_update_import_message_criticity_type_to_string.rb b/db/migrate/20171106111448_update_import_message_criticity_type_to_string.rb index c14450387..a08a10b9a 100644 --- a/db/migrate/20171106111448_update_import_message_criticity_type_to_string.rb +++ b/db/migrate/20171106111448_update_import_message_criticity_type_to_string.rb @@ -7,10 +7,10 @@ class UpdateImportMessageCriticityTypeToString < ActiveRecord::Migration        when 0 then "info"        when 1 then "warning"        when 2 then "error" -      else  +      else          "info"        end      end -    ImportMessage.all.each { |im| im.update_attribute(:criticity, change_criticity_value(im.criticity)) } +    Import::Message.all.each { |im| im.update_attribute(:criticity, change_criticity_value(im.criticity)) }    end  end diff --git a/db/migrate/20180306152953_update_imports_names.rb b/db/migrate/20180306152953_update_imports_names.rb new file mode 100644 index 000000000..086d5ce5a --- /dev/null +++ b/db/migrate/20180306152953_update_imports_names.rb @@ -0,0 +1,8 @@ +class UpdateImportsNames < ActiveRecord::Migration +  def change +    Import::Base.all.pluck(:type).uniq.each do |type| +      next if type =~ /^Imports/ +      Import::Base.where(type: type).update_all type: "Import::#{type.gsub 'Import', ''}" +    end +  end +end diff --git a/db/schema.rb b/db/schema.rb index 276d7f79a..53dbaceb2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,14 +11,13 @@  #  # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180306135204) do +ActiveRecord::Schema.define(version: 20180306152953) do    # These are extensions that must be enabled in order to support this database    enable_extension "plpgsql" -  enable_extension "hstore"    enable_extension "postgis" +  enable_extension "hstore"    enable_extension "unaccent" -  enable_extension "objectid"    create_table "access_links", id: :bigserial, force: :cascade do |t|      t.integer  "access_point_id",                        limit: 8 @@ -91,9 +90,9 @@ ActiveRecord::Schema.define(version: 20180306135204) do      t.integer   "organisation_id", limit: 8      t.datetime  "created_at"      t.datetime  "updated_at" +    t.integer   "workgroup_id",    limit: 8      t.integer   "int_day_types"      t.date      "excluded_dates",                            array: true -    t.integer   "workgroup_id",    limit: 8    end    add_index "calendars", ["organisation_id"], name: "index_calendars_on_organisation_id", using: :btree @@ -120,7 +119,6 @@ ActiveRecord::Schema.define(version: 20180306135204) do      t.datetime "updated_at"      t.date     "end_date"      t.string   "date_type" -    t.string   "mode"    end    add_index "clean_ups", ["referential_id"], name: "index_clean_ups_on_referential_id", using: :btree @@ -755,7 +753,6 @@ ActiveRecord::Schema.define(version: 20180306135204) do      t.datetime "created_at"      t.datetime "updated_at"      t.string   "objectid_format" -    t.string   "registration_number_format"    end    create_table "stop_areas", id: :bigserial, force: :cascade do |t| | 
