diff options
| author | Robert | 2017-08-09 10:54:15 +0200 |
|---|---|---|
| committer | Robert | 2017-08-09 10:54:15 +0200 |
| commit | 70c04d2727179308e98d704c78a668c425b223b9 (patch) | |
| tree | 45901e4f0c4ecde6f7e9faabc54386816d09a44d /db | |
| parent | 586f1a27d2151c72719ee2c2b47352b0e0c096a9 (diff) | |
| parent | 94ae6086a9d3d525d4ce55c2e99f99617a4d4468 (diff) | |
| download | chouette-core-70c04d2727179308e98d704c78a668c425b223b9.tar.bz2 | |
Merge branch 'master' of github.com:af83/stif-boiv
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20170710125809_add_check_sum.rb | 13 | ||||
| -rw-r--r-- | db/migrate/20170710130230_add_check_sum_source.rb | 13 | ||||
| -rw-r--r-- | db/migrate/20170808110333_change_checksum_source_type_to_text.rb | 17 | ||||
| -rw-r--r-- | db/schema.rb | 60 |
4 files changed, 82 insertions, 21 deletions
diff --git a/db/migrate/20170710125809_add_check_sum.rb b/db/migrate/20170710125809_add_check_sum.rb new file mode 100644 index 000000000..b91ddb74d --- /dev/null +++ b/db/migrate/20170710125809_add_check_sum.rb @@ -0,0 +1,13 @@ +class AddCheckSum < ActiveRecord::Migration + def change + add_column :vehicle_journey_at_stops, :checksum, :string + add_column :footnotes, :checksum, :string + add_column :routing_constraint_zones, :checksum, :string + add_column :routes, :checksum, :string + add_column :journey_patterns, :checksum, :string + add_column :vehicle_journeys, :checksum, :string + add_column :time_table_dates, :checksum, :string + add_column :time_table_periods, :checksum, :string + add_column :time_tables, :checksum, :string + end +end diff --git a/db/migrate/20170710130230_add_check_sum_source.rb b/db/migrate/20170710130230_add_check_sum_source.rb new file mode 100644 index 000000000..b8e36e954 --- /dev/null +++ b/db/migrate/20170710130230_add_check_sum_source.rb @@ -0,0 +1,13 @@ +class AddCheckSumSource < ActiveRecord::Migration + def change + add_column :vehicle_journey_at_stops, :checksum_source, :string + add_column :footnotes, :checksum_source, :string + add_column :routing_constraint_zones, :checksum_source, :string + add_column :routes, :checksum_source, :string + add_column :journey_patterns, :checksum_source, :string + add_column :vehicle_journeys, :checksum_source, :string + add_column :time_table_dates, :checksum_source, :string + add_column :time_table_periods, :checksum_source, :string + add_column :time_tables, :checksum_source, :string + end +end diff --git a/db/migrate/20170808110333_change_checksum_source_type_to_text.rb b/db/migrate/20170808110333_change_checksum_source_type_to_text.rb new file mode 100644 index 000000000..731b2a19d --- /dev/null +++ b/db/migrate/20170808110333_change_checksum_source_type_to_text.rb @@ -0,0 +1,17 @@ +class ChangeChecksumSourceTypeToText < ActiveRecord::Migration + def tables + [:vehicle_journey_at_stops, :footnotes, :routing_constraint_zones, :routes, :journey_patterns, :vehicle_journeys, :time_table_dates, :time_table_periods, :time_tables] + end + + def up + self.tables.each do |table| + change_column table, :checksum_source, :text + end + end + + def down + self.tables.each do |table| + change_column table, :checksum_source, :string + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 799283993..01ed67d77 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: 20170802141224) do +ActiveRecord::Schema.define(version: 20170808110333) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -211,11 +211,13 @@ ActiveRecord::Schema.define(version: 20170802141224) do end create_table "footnotes", id: :bigserial, force: :cascade do |t| - t.integer "line_id", limit: 8 + t.integer "line_id", limit: 8 t.string "code" t.string "label" t.datetime "created_at" t.datetime "updated_at" + t.string "checksum" + t.text "checksum_source" end create_table "footnotes_vehicle_journeys", id: false, force: :cascade do |t| @@ -284,12 +286,12 @@ ActiveRecord::Schema.define(version: 20170802141224) do t.datetime "started_at" t.datetime "ended_at" t.string "token_download" - t.string "type", limit: 255 + t.string "type" t.integer "parent_id", limit: 8 t.string "parent_type" - t.integer "current_step", default: 0 - t.integer "total_steps", default: 0 t.datetime "notified_parent_at" + t.integer "current_step", default: 0 + t.integer "total_steps", default: 0 end add_index "imports", ["referential_id"], name: "index_imports_on_referential_id", using: :btree @@ -335,6 +337,8 @@ ActiveRecord::Schema.define(version: 20170802141224) do t.integer "section_status", default: 0, null: false t.datetime "created_at" t.datetime "updated_at" + t.string "checksum" + t.text "checksum_source" end add_index "journey_patterns", ["objectid"], name: "journey_patterns_objectid_key", unique: true, using: :btree @@ -543,6 +547,8 @@ ActiveRecord::Schema.define(version: 20170802141224) do t.string "wayback" t.datetime "created_at" t.datetime "updated_at" + t.string "checksum" + t.text "checksum_source" end add_index "routes", ["objectid"], name: "routes_objectid_key", unique: true, using: :btree @@ -551,11 +557,13 @@ ActiveRecord::Schema.define(version: 20170802141224) do t.string "name" t.datetime "created_at" t.datetime "updated_at" - t.string "objectid", null: false - t.integer "object_version", limit: 8 + t.string "objectid", null: false + t.integer "object_version", limit: 8 t.string "creator_id" - t.integer "route_id", limit: 8 - t.integer "stop_point_ids", limit: 8, array: true + t.integer "route_id", limit: 8 + t.integer "stop_point_ids", limit: 8, array: true + t.string "checksum" + t.text "checksum_source" end create_table "routing_constraints_lines", id: false, force: :cascade do |t| @@ -607,7 +615,7 @@ ActiveRecord::Schema.define(version: 20170802141224) do create_table "stop_areas", id: :bigserial, force: :cascade do |t| t.integer "parent_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 t.string "creator_id" t.string "name" @@ -616,8 +624,8 @@ ActiveRecord::Schema.define(version: 20170802141224) do t.string "registration_number" t.string "nearest_topic_name" t.integer "fare_code" - t.decimal "longitude", precision: 19, scale: 16 - t.decimal "latitude", precision: 19, scale: 16 + t.decimal "longitude", precision: 19, scale: 16 + t.decimal "latitude", precision: 19, scale: 16 t.string "long_lat_type" t.string "country_code" t.string "street_name" @@ -635,7 +643,7 @@ ActiveRecord::Schema.define(version: 20170802141224) do t.datetime "deleted_at" t.datetime "created_at" t.datetime "updated_at" - t.string "stif_type", limit: 255 + t.string "stif_type" end add_index "stop_areas", ["name"], name: "index_stop_areas_on_name", using: :btree @@ -684,37 +692,43 @@ ActiveRecord::Schema.define(version: 20170802141224) do add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree create_table "time_table_dates", id: :bigserial, force: :cascade do |t| - t.integer "time_table_id", limit: 8, null: false + t.integer "time_table_id", limit: 8, null: false t.date "date" - t.integer "position", null: false + t.integer "position", null: false t.boolean "in_out" + t.string "checksum" + t.text "checksum_source" end add_index "time_table_dates", ["time_table_id"], name: "index_time_table_dates_on_time_table_id", using: :btree create_table "time_table_periods", id: :bigserial, force: :cascade do |t| - t.integer "time_table_id", limit: 8, null: false + t.integer "time_table_id", limit: 8, null: false t.date "period_start" t.date "period_end" - t.integer "position", null: false + t.integer "position", null: false + t.string "checksum" + t.text "checksum_source" end add_index "time_table_periods", ["time_table_id"], name: "index_time_table_periods_on_time_table_id", using: :btree create_table "time_tables", id: :bigserial, force: :cascade do |t| - t.string "objectid", null: false - t.integer "object_version", limit: 8, default: 1 + t.string "objectid", null: false + t.integer "object_version", limit: 8, default: 1 t.string "creator_id" t.string "version" t.string "comment" - t.integer "int_day_types", default: 0 + t.integer "int_day_types", default: 0 t.date "start_date" t.date "end_date" t.integer "calendar_id", limit: 8 t.datetime "created_at" t.datetime "updated_at" - t.string "color", limit: 255 + t.string "color" t.integer "created_from_id" + t.string "checksum" + t.text "checksum_source" end add_index "time_tables", ["calendar_id"], name: "index_time_tables_on_calendar_id", using: :btree @@ -791,6 +805,8 @@ ActiveRecord::Schema.define(version: 20170802141224) do t.string "for_alighting" t.integer "departure_day_offset", default: 0 t.integer "arrival_day_offset", default: 0 + t.string "checksum" + t.text "checksum_source" end add_index "vehicle_journey_at_stops", ["stop_point_id"], name: "index_vehicle_journey_at_stops_on_stop_pointid", using: :btree @@ -816,6 +832,8 @@ ActiveRecord::Schema.define(version: 20170802141224) do t.integer "journey_category", default: 0, null: false t.datetime "created_at" t.datetime "updated_at" + t.string "checksum" + t.text "checksum_source" end add_index "vehicle_journeys", ["objectid"], name: "vehicle_journeys_objectid_key", unique: true, using: :btree |
