diff options
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20180313110900_add_costs_to_routes.rb | 5 | ||||
| -rw-r--r-- | db/migrate/20180315152714_remove_short_name_from_calendars.rb | 5 | ||||
| -rw-r--r-- | db/migrate/20180319043333_remove_attributes_from_models.rb | 6 | ||||
| -rw-r--r-- | db/migrate/20180326085804_bind_exports_and_imports_types_to_workgroups.rb | 6 | ||||
| -rw-r--r-- | db/schema.rb | 69 | ||||
| -rw-r--r-- | db/seeds/stif.seeds.rb | 1 |
6 files changed, 79 insertions, 13 deletions
diff --git a/db/migrate/20180313110900_add_costs_to_routes.rb b/db/migrate/20180313110900_add_costs_to_routes.rb new file mode 100644 index 000000000..d47e86cf0 --- /dev/null +++ b/db/migrate/20180313110900_add_costs_to_routes.rb @@ -0,0 +1,5 @@ +class AddCostsToRoutes < ActiveRecord::Migration + def change + add_column :routes, :costs, :json + end +end diff --git a/db/migrate/20180315152714_remove_short_name_from_calendars.rb b/db/migrate/20180315152714_remove_short_name_from_calendars.rb new file mode 100644 index 000000000..3b6759f7b --- /dev/null +++ b/db/migrate/20180315152714_remove_short_name_from_calendars.rb @@ -0,0 +1,5 @@ +class RemoveShortNameFromCalendars < ActiveRecord::Migration + def change + remove_column :calendars, :short_name, :string + end +end diff --git a/db/migrate/20180319043333_remove_attributes_from_models.rb b/db/migrate/20180319043333_remove_attributes_from_models.rb new file mode 100644 index 000000000..e6de2987e --- /dev/null +++ b/db/migrate/20180319043333_remove_attributes_from_models.rb @@ -0,0 +1,6 @@ +class RemoveAttributesFromModels < ActiveRecord::Migration + def change + remove_column "vehicle_journeys", "status_value" + remove_column "journey_patterns", "section_status" + end +end diff --git a/db/migrate/20180326085804_bind_exports_and_imports_types_to_workgroups.rb b/db/migrate/20180326085804_bind_exports_and_imports_types_to_workgroups.rb new file mode 100644 index 000000000..d75336673 --- /dev/null +++ b/db/migrate/20180326085804_bind_exports_and_imports_types_to_workgroups.rb @@ -0,0 +1,6 @@ +class BindExportsAndImportsTypesToWorkgroups < ActiveRecord::Migration + def change + add_column :workgroups, "import_types", :string, default: [], array: true + add_column :workgroups, "export_types", :string, default: [], array: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 48aab7dcf..d90bf7b6c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,12 +11,14 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180308095116) do +ActiveRecord::Schema.define(version: 20180319043333) do + # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" - enable_extension "postgis" enable_extension "hstore" + enable_extension "postgis" enable_extension "unaccent" + enable_extension "objectid" create_table "access_links", id: :bigserial, force: :cascade do |t| t.integer "access_point_id", limit: 8 @@ -82,20 +84,18 @@ ActiveRecord::Schema.define(version: 20180308095116) do create_table "calendars", id: :bigserial, force: :cascade do |t| t.string "name" - t.string "short_name" t.daterange "date_ranges", array: true t.date "dates", array: true t.boolean "shared", default: false 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 - add_index "calendars", ["short_name"], name: "index_calendars_on_short_name", unique: true, using: :btree add_index "calendars", ["workgroup_id"], name: "index_calendars_on_workgroup_id", using: :btree create_table "clean_up_results", id: :bigserial, force: :cascade do |t| @@ -118,6 +118,7 @@ ActiveRecord::Schema.define(version: 20180308095116) 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 @@ -298,18 +299,58 @@ ActiveRecord::Schema.define(version: 20180308095116) do add_index "custom_fields", ["resource_type"], name: "index_custom_fields_on_resource_type", using: :btree + create_table "export_messages", id: :bigserial, force: :cascade do |t| + t.string "criticity" + t.string "message_key" + t.hstore "message_attributes" + t.integer "export_id", limit: 8 + t.integer "resource_id", limit: 8 + t.datetime "created_at" + t.datetime "updated_at" + t.hstore "resource_attributes" + end + + add_index "export_messages", ["export_id"], name: "index_export_messages_on_export_id", using: :btree + add_index "export_messages", ["resource_id"], name: "index_export_messages_on_resource_id", using: :btree + + create_table "export_resources", id: :bigserial, force: :cascade do |t| + t.integer "export_id", limit: 8 + t.string "status" + t.datetime "created_at" + t.datetime "updated_at" + t.string "resource_type" + t.string "reference" + t.string "name" + t.hstore "metrics" + end + + add_index "export_resources", ["export_id"], name: "index_export_resources_on_export_id", using: :btree + create_table "exports", id: :bigserial, force: :cascade do |t| - t.integer "referential_id", limit: 8 t.string "status" - t.string "type" - t.string "options" + t.string "current_step_id" + t.float "current_step_progress" + t.integer "workbench_id", limit: 8 + t.integer "referential_id", limit: 8 + t.string "name" t.datetime "created_at" t.datetime "updated_at" - t.string "references_type" - t.string "reference_ids" + t.string "file" + t.datetime "started_at" + t.datetime "ended_at" + t.string "token_upload" + t.string "type" + t.integer "parent_id", limit: 8 + t.string "parent_type" + t.datetime "notified_parent_at" + t.integer "current_step", default: 0 + t.integer "total_steps", default: 0 + t.string "creator" + t.hstore "options" end add_index "exports", ["referential_id"], name: "index_exports_on_referential_id", using: :btree + add_index "exports", ["workbench_id"], name: "index_exports_on_workbench_id", using: :btree create_table "facilities", id: :bigserial, force: :cascade do |t| t.integer "stop_area_id", limit: 8 @@ -445,7 +486,7 @@ ActiveRecord::Schema.define(version: 20180308095116) do create_table "journey_patterns", id: :bigserial, force: :cascade do |t| t.integer "route_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 t.string "name" t.string "comment" @@ -453,7 +494,6 @@ ActiveRecord::Schema.define(version: 20180308095116) do t.string "published_name" t.integer "departure_stop_point_id", limit: 8 t.integer "arrival_stop_point_id", limit: 8 - t.integer "section_status", default: 0, null: false t.datetime "created_at" t.datetime "updated_at" t.string "checksum" @@ -702,6 +742,7 @@ ActiveRecord::Schema.define(version: 20180308095116) do t.string "checksum" t.text "checksum_source" t.string "data_source_ref" + t.json "costs" end add_index "routes", ["objectid"], name: "routes_objectid_key", unique: true, using: :btree @@ -765,6 +806,7 @@ ActiveRecord::Schema.define(version: 20180308095116) 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| @@ -802,6 +844,8 @@ ActiveRecord::Schema.define(version: 20180308095116) do t.jsonb "localized_names" t.datetime "confirmed_at" + t.json "custom_field_values" + end add_index "stop_areas", ["name"], name: "index_stop_areas_on_name", using: :btree @@ -975,7 +1019,6 @@ ActiveRecord::Schema.define(version: 20180308095116) do t.string "objectid", null: false t.integer "object_version", limit: 8 t.string "comment" - t.string "status_value" t.string "transport_mode" t.string "published_journey_name" t.string "published_journey_identifier" diff --git a/db/seeds/stif.seeds.rb b/db/seeds/stif.seeds.rb index f898021ce..aa87b6f6c 100644 --- a/db/seeds/stif.seeds.rb +++ b/db/seeds/stif.seeds.rb @@ -8,6 +8,7 @@ line_referential = LineReferential.find_or_create_by!(name: "CodifLigne", object workgroup = Workgroup.find_or_create_by!(name: "Gestion de l'offre théorique IDFm") do |w| w.line_referential = line_referential w.stop_area_referential = stop_area_referential + w.export_types = ["Export::Netex"] end Workbench.update_all workgroup_id: workgroup |
