diff options
| author | cedricnjanga | 2017-11-22 00:45:48 +0100 | 
|---|---|---|
| committer | cedricnjanga | 2017-11-22 00:45:48 +0100 | 
| commit | 510afa8b86fb6f5e4b7d9c39e3a6d3b071cd8ce9 (patch) | |
| tree | 1b3a162722389df4f6b2e444d03e91131032f0d5 /db | |
| parent | be2bd2e4f902ef12a21425ebe7dcf5699768762a (diff) | |
| parent | 96afaed78fa043449c0264ea09f0106147755c8e (diff) | |
| download | chouette-core-510afa8b86fb6f5e4b7d9c39e3a6d3b071cd8ce9.tar.bz2 | |
Merge branch 'master' into 4941-refactoring_object_id
Diffstat (limited to 'db')
7 files changed, 76 insertions, 66 deletions
diff --git a/db/migrate/20170307155042_set_updated_at.rb b/db/migrate/20170307155042_set_updated_at.rb index 84ffd8211..16bfda3d9 100644 --- a/db/migrate/20170307155042_set_updated_at.rb +++ b/db/migrate/20170307155042_set_updated_at.rb @@ -1,6 +1,6 @@  class SetUpdatedAt < ActiveRecord::Migration    def up -    models = %w(VehicleJourney Timeband TimeTable StopPoint StopArea RoutingConstraintZone Route RouteSection PtLink Network Line +    models = %w(VehicleJourney Timeband TimeTable StopPoint StopArea RoutingConstraintZone Route PtLink Network Line       JourneyPattern GroupOfLine ConnectionLink Company AccessPoint AccessLink)      models.each do |table| diff --git a/db/migrate/20171109101358_drop_table_journey_pattern_sections.rb b/db/migrate/20171109101358_drop_table_journey_pattern_sections.rb new file mode 100644 index 000000000..a7bb482a5 --- /dev/null +++ b/db/migrate/20171109101358_drop_table_journey_pattern_sections.rb @@ -0,0 +1,5 @@ +class DropTableJourneyPatternSections < ActiveRecord::Migration +  def change +    drop_table :journey_pattern_sections +  end +end diff --git a/db/migrate/20171109101514_drop_table_route_sections.rb b/db/migrate/20171109101514_drop_table_route_sections.rb new file mode 100644 index 000000000..c009ed8ec --- /dev/null +++ b/db/migrate/20171109101514_drop_table_route_sections.rb @@ -0,0 +1,5 @@ +class DropTableRouteSections < ActiveRecord::Migration +  def change +    drop_table :route_sections +  end +end diff --git a/db/migrate/20171110114408_change_foreign_keys_to_bigint_2.rb b/db/migrate/20171110114408_change_foreign_keys_to_bigint_2.rb new file mode 100644 index 000000000..3bd4525ff --- /dev/null +++ b/db/migrate/20171110114408_change_foreign_keys_to_bigint_2.rb @@ -0,0 +1,20 @@ +class ChangeForeignKeysToBigint2 < ActiveRecord::Migration +  def change +    change_column :api_keys, :organisation_id, :bigint +    change_column :compliance_check_blocks, :compliance_check_set_id, :bigint +    change_column :compliance_check_messages, :compliance_check_id, :bigint +    change_column :compliance_check_messages, :compliance_check_resource_id, :bigint +    change_column :compliance_check_messages, :compliance_check_set_id, :bigint +    change_column :compliance_check_sets, :referential_id, :bigint +    change_column :compliance_check_sets, :compliance_control_set_id, :bigint +    change_column :compliance_check_sets, :workbench_id, :bigint +    change_column :compliance_check_sets, :parent_id, :bigint +    change_column :compliance_checks, :compliance_check_set_id, :bigint +    change_column :compliance_checks, :compliance_check_block_id, :bigint +    change_column :compliance_control_blocks, :compliance_control_set_id, :bigint +    change_column :compliance_control_sets, :organisation_id, :bigint +    change_column :compliance_controls, :compliance_control_set_id, :bigint +    change_column :compliance_controls, :compliance_control_block_id, :bigint +    change_column :time_tables, :created_from_id, :bigint +  end +end diff --git a/db/migrate/20171110130416_change_foreign_keys_to_bigint_3.rb b/db/migrate/20171110130416_change_foreign_keys_to_bigint_3.rb new file mode 100644 index 000000000..bfe1b4be2 --- /dev/null +++ b/db/migrate/20171110130416_change_foreign_keys_to_bigint_3.rb @@ -0,0 +1,5 @@ +class ChangeForeignKeysToBigint3 < ActiveRecord::Migration +  def change +    change_column :compliance_check_resources, :compliance_check_set_id, :bigint +  end +end diff --git a/db/migrate/20171113101005_change_type_to_resource_type_from_compliance_check_resources.rb b/db/migrate/20171113101005_change_type_to_resource_type_from_compliance_check_resources.rb new file mode 100644 index 000000000..6d1aaa883 --- /dev/null +++ b/db/migrate/20171113101005_change_type_to_resource_type_from_compliance_check_resources.rb @@ -0,0 +1,5 @@ +class ChangeTypeToResourceTypeFromComplianceCheckResources < ActiveRecord::Migration +  def change +    rename_column :compliance_check_resources, :type, :resource_type +  end +end diff --git a/db/schema.rb b/db/schema.rb index cd5fb8627..a992eb32b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@  #  # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171109101605) do +ActiveRecord::Schema.define(version: 20171113101005) do    # These are extensions that must be enabled in order to support this database    enable_extension "plpgsql" @@ -77,7 +77,7 @@ ActiveRecord::Schema.define(version: 20171109101605) do      t.string   "name"      t.datetime "created_at"      t.datetime "updated_at" -    t.integer  "organisation_id" +    t.integer  "organisation_id", limit: 8    end    add_index "api_keys", ["organisation_id"], name: "index_api_keys_on_organisation_id", using: :btree @@ -148,23 +148,23 @@ ActiveRecord::Schema.define(version: 20171109101605) do    create_table "compliance_check_blocks", id: :bigserial, force: :cascade do |t|      t.string   "name"      t.hstore   "condition_attributes" -    t.integer  "compliance_check_set_id" -    t.datetime "created_at",              null: false -    t.datetime "updated_at",              null: false +    t.integer  "compliance_check_set_id", limit: 8 +    t.datetime "created_at",                        null: false +    t.datetime "updated_at",                        null: false    end    add_index "compliance_check_blocks", ["compliance_check_set_id"], name: "index_compliance_check_blocks_on_compliance_check_set_id", using: :btree    create_table "compliance_check_messages", id: :bigserial, force: :cascade do |t| -    t.integer  "compliance_check_id" -    t.integer  "compliance_check_resource_id" +    t.integer  "compliance_check_id",          limit: 8 +    t.integer  "compliance_check_resource_id", limit: 8      t.string   "message_key"      t.hstore   "message_attributes"      t.hstore   "resource_attributes" -    t.datetime "created_at",                   null: false -    t.datetime "updated_at",                   null: false +    t.datetime "created_at",                             null: false +    t.datetime "updated_at",                             null: false      t.string   "status" -    t.integer  "compliance_check_set_id" +    t.integer  "compliance_check_set_id",      limit: 8    end    add_index "compliance_check_messages", ["compliance_check_id"], name: "index_compliance_check_messages_on_compliance_check_id", using: :btree @@ -174,26 +174,26 @@ ActiveRecord::Schema.define(version: 20171109101605) do    create_table "compliance_check_resources", id: :bigserial, force: :cascade do |t|      t.string   "status"      t.string   "name" -    t.string   "type" +    t.string   "resource_type"      t.string   "reference"      t.hstore   "metrics" -    t.datetime "created_at",              null: false -    t.datetime "updated_at",              null: false -    t.integer  "compliance_check_set_id" +    t.datetime "created_at",                        null: false +    t.datetime "updated_at",                        null: false +    t.integer  "compliance_check_set_id", limit: 8    end    add_index "compliance_check_resources", ["compliance_check_set_id"], name: "index_compliance_check_resources_on_compliance_check_set_id", using: :btree    create_table "compliance_check_sets", id: :bigserial, force: :cascade do |t| -    t.integer  "referential_id" -    t.integer  "compliance_control_set_id" -    t.integer  "workbench_id" +    t.integer  "referential_id",            limit: 8 +    t.integer  "compliance_control_set_id", limit: 8 +    t.integer  "workbench_id",              limit: 8      t.string   "creator"      t.string   "status" -    t.integer  "parent_id" +    t.integer  "parent_id",                 limit: 8      t.string   "parent_type" -    t.datetime "created_at",                null: false -    t.datetime "updated_at",                null: false +    t.datetime "created_at",                          null: false +    t.datetime "updated_at",                          null: false      t.string   "current_step_id"      t.float    "current_step_progress"      t.string   "name" @@ -207,16 +207,16 @@ ActiveRecord::Schema.define(version: 20171109101605) do    add_index "compliance_check_sets", ["workbench_id"], name: "index_compliance_check_sets_on_workbench_id", using: :btree    create_table "compliance_checks", id: :bigserial, force: :cascade do |t| -    t.integer  "compliance_check_set_id" -    t.integer  "compliance_check_block_id" +    t.integer  "compliance_check_set_id",   limit: 8 +    t.integer  "compliance_check_block_id", limit: 8      t.string   "type"      t.hstore   "control_attributes"      t.string   "name"      t.string   "code"      t.string   "criticity"      t.text     "comment" -    t.datetime "created_at",                null: false -    t.datetime "updated_at",                null: false +    t.datetime "created_at",                          null: false +    t.datetime "updated_at",                          null: false      t.string   "origin_code"    end @@ -226,34 +226,34 @@ ActiveRecord::Schema.define(version: 20171109101605) do    create_table "compliance_control_blocks", id: :bigserial, force: :cascade do |t|      t.string   "name"      t.hstore   "condition_attributes" -    t.integer  "compliance_control_set_id" -    t.datetime "created_at",                null: false -    t.datetime "updated_at",                null: false +    t.integer  "compliance_control_set_id", limit: 8 +    t.datetime "created_at",                          null: false +    t.datetime "updated_at",                          null: false    end    add_index "compliance_control_blocks", ["compliance_control_set_id"], name: "index_compliance_control_blocks_on_compliance_control_set_id", using: :btree    create_table "compliance_control_sets", id: :bigserial, force: :cascade do |t|      t.string   "name" -    t.integer  "organisation_id" -    t.datetime "created_at",      null: false -    t.datetime "updated_at",      null: false +    t.integer  "organisation_id", limit: 8 +    t.datetime "created_at",                null: false +    t.datetime "updated_at",                null: false    end    add_index "compliance_control_sets", ["organisation_id"], name: "index_compliance_control_sets_on_organisation_id", using: :btree    create_table "compliance_controls", id: :bigserial, force: :cascade do |t| -    t.integer  "compliance_control_set_id" +    t.integer  "compliance_control_set_id",   limit: 8      t.string   "type"      t.hstore   "control_attributes"      t.string   "name"      t.string   "code"      t.string   "criticity"      t.text     "comment" -    t.datetime "created_at",                  null: false -    t.datetime "updated_at",                  null: false +    t.datetime "created_at",                            null: false +    t.datetime "updated_at",                            null: false      t.string   "origin_code" -    t.integer  "compliance_control_block_id" +    t.integer  "compliance_control_block_id", limit: 8    end    add_index "compliance_controls", ["code", "compliance_control_set_id"], name: "index_compliance_controls_on_code_and_compliance_control_set_id", unique: true, using: :btree @@ -431,18 +431,6 @@ ActiveRecord::Schema.define(version: 20171109101605) do    add_index "journey_frequencies", ["timeband_id"], name: "index_journey_frequencies_on_timeband_id", using: :btree    add_index "journey_frequencies", ["vehicle_journey_id"], name: "index_journey_frequencies_on_vehicle_journey_id", using: :btree -  create_table "journey_pattern_sections", id: :bigserial, force: :cascade do |t| -    t.integer  "journey_pattern_id", limit: 8, null: false -    t.integer  "route_section_id",   limit: 8, null: false -    t.integer  "rank",                         null: false -    t.datetime "created_at" -    t.datetime "updated_at" -  end - -  add_index "journey_pattern_sections", ["journey_pattern_id", "route_section_id", "rank"], name: "index_jps_on_journey_pattern_id_and_route_section_id_and_rank", unique: true, using: :btree -  add_index "journey_pattern_sections", ["journey_pattern_id"], name: "index_journey_pattern_sections_on_journey_pattern_id", using: :btree -  add_index "journey_pattern_sections", ["route_section_id"], name: "index_journey_pattern_sections_on_route_section_id", using: :btree -    create_table "journey_patterns", id: :bigserial, force: :cascade do |t|      t.integer  "route_id",                limit: 8      t.string   "objectid",                                      null: false @@ -654,20 +642,6 @@ ActiveRecord::Schema.define(version: 20171109101605) do    add_index "referentials", ["created_from_id"], name: "index_referentials_on_created_from_id", using: :btree    add_index "referentials", ["referential_suite_id"], name: "index_referentials_on_referential_suite_id", using: :btree -  create_table "route_sections", id: :bigserial, force: :cascade do |t| -    t.integer  "departure_id",       limit: 8 -    t.integer  "arrival_id",         limit: 8 -    t.geometry "input_geometry",     limit: {:srid=>4326, :type=>"line_string"} -    t.geometry "processed_geometry", limit: {:srid=>4326, :type=>"line_string"} -    t.string   "objectid",                                                       null: false -    t.integer  "object_version",     limit: 8 -    t.string   "creator_id" -    t.float    "distance" -    t.boolean  "no_processing" -    t.datetime "created_at" -    t.datetime "updated_at" -  end -    create_table "routes", id: :bigserial, force: :cascade do |t|      t.integer  "line_id",           limit: 8      t.string   "objectid",                    null: false @@ -864,7 +838,7 @@ ActiveRecord::Schema.define(version: 20171109101605) do      t.datetime "created_at"      t.datetime "updated_at"      t.string   "color" -    t.integer  "created_from_id" +    t.integer  "created_from_id", limit: 8      t.string   "checksum"      t.text     "checksum_source"      t.string   "data_source_ref" @@ -1013,16 +987,12 @@ ActiveRecord::Schema.define(version: 20171109101605) do    add_foreign_key "group_of_lines_lines", "group_of_lines", name: "groupofline_group_fkey", on_delete: :cascade    add_foreign_key "journey_frequencies", "timebands", on_delete: :nullify    add_foreign_key "journey_frequencies", "vehicle_journeys", on_delete: :nullify -  add_foreign_key "journey_pattern_sections", "journey_patterns", on_delete: :cascade -  add_foreign_key "journey_pattern_sections", "route_sections", on_delete: :cascade    add_foreign_key "journey_patterns", "routes", name: "jp_route_fkey", on_delete: :cascade    add_foreign_key "journey_patterns", "stop_points", column: "arrival_stop_point_id", name: "arrival_point_fkey", on_delete: :nullify    add_foreign_key "journey_patterns", "stop_points", column: "departure_stop_point_id", name: "departure_point_fkey", on_delete: :nullify    add_foreign_key "journey_patterns_stop_points", "journey_patterns", name: "jpsp_jp_fkey", on_delete: :cascade    add_foreign_key "journey_patterns_stop_points", "stop_points", name: "jpsp_stoppoint_fkey", on_delete: :cascade    add_foreign_key "referentials", "referential_suites" -  add_foreign_key "route_sections", "stop_areas", column: "arrival_id" -  add_foreign_key "route_sections", "stop_areas", column: "departure_id"    add_foreign_key "routes", "routes", column: "opposite_route_id", name: "route_opposite_route_fkey"    add_foreign_key "stop_areas", "stop_areas", column: "parent_id", name: "area_parent_fkey", on_delete: :nullify    add_foreign_key "stop_areas_stop_areas", "stop_areas", column: "child_id", name: "stoparea_child_fkey", on_delete: :cascade  | 
