aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorLuc Donnet2017-12-21 15:55:21 +0100
committerLuc Donnet2017-12-21 15:55:21 +0100
commit1d7a0cb4ce78603dac88c4054a658f02bf9fbb22 (patch)
tree516415d7d825d6e421fecdc8c85f11afc0c3a176 /db
parentbdaca45a64b362091b5fbbdd0c23bd20e01d9208 (diff)
parenta832fa35fee4b472053fd14a14e54221c42c11a8 (diff)
downloadchouette-core-1d7a0cb4ce78603dac88c4054a658f02bf9fbb22.tar.bz2
Merge branch 'master' into 5316-migrate-compliance-control-and-check-attributes-from-hs
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20171214131755_create_business_calendars.rb14
-rw-r--r--db/migrate/20171215144543_rename_business_calendars_to_purchase_windows.rb5
-rw-r--r--db/migrate/20171215145023_update_purchase_windows_attributes.rb13
-rw-r--r--db/migrate/20171219170128_add_features_to_organisations.rb5
-rw-r--r--db/migrate/20171220164059_add_waiting_time_to_stop_areas.rb5
-rw-r--r--db/schema.rb20
6 files changed, 60 insertions, 2 deletions
diff --git a/db/migrate/20171214131755_create_business_calendars.rb b/db/migrate/20171214131755_create_business_calendars.rb
new file mode 100644
index 000000000..aa7c1ab12
--- /dev/null
+++ b/db/migrate/20171214131755_create_business_calendars.rb
@@ -0,0 +1,14 @@
+class CreateBusinessCalendars < ActiveRecord::Migration
+ def change
+ create_table :business_calendars do |t|
+ t.string :name
+ t.string :short_name
+ t.string :color
+ t.daterange :date_ranges, array: true
+ t.date :dates, array: true
+ t.belongs_to :organisation, index: true
+
+ t.timestamps null: false
+ end
+ end
+end
diff --git a/db/migrate/20171215144543_rename_business_calendars_to_purchase_windows.rb b/db/migrate/20171215144543_rename_business_calendars_to_purchase_windows.rb
new file mode 100644
index 000000000..d4467d6a7
--- /dev/null
+++ b/db/migrate/20171215144543_rename_business_calendars_to_purchase_windows.rb
@@ -0,0 +1,5 @@
+class RenameBusinessCalendarsToPurchaseWindows < ActiveRecord::Migration
+ def change
+ rename_table :business_calendars, :purchase_windows
+ end
+end
diff --git a/db/migrate/20171215145023_update_purchase_windows_attributes.rb b/db/migrate/20171215145023_update_purchase_windows_attributes.rb
new file mode 100644
index 000000000..48dfb15bc
--- /dev/null
+++ b/db/migrate/20171215145023_update_purchase_windows_attributes.rb
@@ -0,0 +1,13 @@
+class UpdatePurchaseWindowsAttributes < ActiveRecord::Migration
+ def change
+ add_column :purchase_windows, :objectid, :string
+ add_column :purchase_windows, :checksum, :string
+ add_column :purchase_windows, :checksum_source, :text
+
+ remove_column :purchase_windows, :short_name, :string
+ remove_column :purchase_windows, :dates, :date
+ remove_column :purchase_windows, :organisation_id, :integer
+
+ add_reference :purchase_windows, :referential, type: :bigint, index: true
+ end
+end
diff --git a/db/migrate/20171219170128_add_features_to_organisations.rb b/db/migrate/20171219170128_add_features_to_organisations.rb
new file mode 100644
index 000000000..bbec3297b
--- /dev/null
+++ b/db/migrate/20171219170128_add_features_to_organisations.rb
@@ -0,0 +1,5 @@
+class AddFeaturesToOrganisations < ActiveRecord::Migration
+ def change
+ add_column :organisations, :features, :string, array: true, default: []
+ end
+end
diff --git a/db/migrate/20171220164059_add_waiting_time_to_stop_areas.rb b/db/migrate/20171220164059_add_waiting_time_to_stop_areas.rb
new file mode 100644
index 000000000..369fed3ab
--- /dev/null
+++ b/db/migrate/20171220164059_add_waiting_time_to_stop_areas.rb
@@ -0,0 +1,5 @@
+class AddWaitingTimeToStopAreas < ActiveRecord::Migration
+ def change
+ add_column :stop_areas, :waiting_time, :integer
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 50ee0dcf4..182df3159 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: 20171218174509) do
+ActiveRecord::Schema.define(version: 20171220164059) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -403,9 +403,9 @@ ActiveRecord::Schema.define(version: 20171218174509) do
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.datetime "notified_parent_at"
t.string "creator"
end
@@ -552,6 +552,7 @@ ActiveRecord::Schema.define(version: 20171218174509) do
t.datetime "synced_at"
t.hstore "sso_attributes"
t.string "custom_view"
+ t.string "features", default: [], array: true
end
add_index "organisations", ["code"], name: "index_organisations_on_code", unique: true, using: :btree
@@ -571,6 +572,20 @@ ActiveRecord::Schema.define(version: 20171218174509) do
add_index "pt_links", ["objectid"], name: "pt_links_objectid_key", unique: true, using: :btree
+ create_table "purchase_windows", id: :bigserial, force: :cascade do |t|
+ t.string "name"
+ t.string "color"
+ t.daterange "date_ranges", array: true
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "objectid"
+ t.string "checksum"
+ t.text "checksum_source"
+ t.integer "referential_id", limit: 8
+ end
+
+ add_index "purchase_windows", ["referential_id"], name: "index_purchase_windows_on_referential_id", using: :btree
+
create_table "referential_clonings", id: :bigserial, force: :cascade do |t|
t.string "status"
t.datetime "started_at"
@@ -737,6 +752,7 @@ ActiveRecord::Schema.define(version: 20171218174509) do
t.datetime "created_at"
t.datetime "updated_at"
t.string "stif_type"
+ t.integer "waiting_time"
end
add_index "stop_areas", ["name"], name: "index_stop_areas_on_name", using: :btree