diff options
| author | Zakaria BOUZIANE | 2015-03-09 14:01:10 +0100 |
|---|---|---|
| committer | Zakaria BOUZIANE | 2015-03-09 14:01:10 +0100 |
| commit | 0d5adf2fad5c0ddd8efc1eca9dc6d8e9c48b049d (patch) | |
| tree | 36e3d37edd325d59b6056c738305d5d60f74beee /db | |
| parent | f0456f7334b8fb4442a51bb370fdc0c5a3ea2cd0 (diff) | |
| download | chouette-core-0d5adf2fad5c0ddd8efc1eca9dc6d8e9c48b049d.tar.bz2 | |
Prepare merging V2_5 into V3
Diffstat (limited to 'db')
13 files changed, 131 insertions, 7 deletions
diff --git a/db/migrate/20131104110509_create_rule_parameter_sets.rb b/db/migrate/20131104110509_create_rule_parameter_sets.rb index b2ceb0dbb..01ddef4a7 100644 --- a/db/migrate/20131104110509_create_rule_parameter_sets.rb +++ b/db/migrate/20131104110509_create_rule_parameter_sets.rb @@ -2,7 +2,7 @@ class CreateRuleParameterSets < ActiveRecord::Migration def up unless table_exists? :rule_parameter_sets create_table :rule_parameter_sets do |a| - a.belongs_to :referential ,:limit => 8 + a.integer :referential_id ,:limit => 8 a.text :parameters a.string :name a.timestamps diff --git a/db/migrate/20150120125337_create_footnotes.ninoxe_engine.rb b/db/migrate/20150120125337_create_footnotes.ninoxe_engine.rb new file mode 100644 index 000000000..ce27d4ee8 --- /dev/null +++ b/db/migrate/20150120125337_create_footnotes.ninoxe_engine.rb @@ -0,0 +1,12 @@ +# This migration comes from ninoxe_engine (originally 20150115153453) +class CreateFootnotes < ActiveRecord::Migration + def change + create_table :footnotes do |t| + t.integer "line_id", :limit => 8 + t.string :code + t.string :label + + t.timestamps + end + end +end diff --git a/db/migrate/20150120183020_create_vehicle_journey_footnotes.ninoxe_engine.rb b/db/migrate/20150120183020_create_vehicle_journey_footnotes.ninoxe_engine.rb new file mode 100644 index 000000000..220d69d01 --- /dev/null +++ b/db/migrate/20150120183020_create_vehicle_journey_footnotes.ninoxe_engine.rb @@ -0,0 +1,9 @@ +# This migration comes from ninoxe_engine (originally 20150119160029) +class CreateVehicleJourneyFootnotes < ActiveRecord::Migration + def change + create_table :footnotes_vehicle_journeys, :id => false, :force => true do |t| + t.integer "vehicle_journey_id", :limit => 8 + t.integer "footnote_id", :limit => 8 + end + end +end diff --git a/db/migrate/20150121144108_add_hub_restrictions_to_organisation.rb b/db/migrate/20150121144108_add_hub_restrictions_to_organisation.rb new file mode 100644 index 000000000..27955b43f --- /dev/null +++ b/db/migrate/20150121144108_add_hub_restrictions_to_organisation.rb @@ -0,0 +1,10 @@ +class AddHubRestrictionsToOrganisation < ActiveRecord::Migration + def self.up + add_column :organisations, :hub_restrictions_by_default, :boolean + add_column :referentials, :hub_restrictions, :boolean + end + def self.down + remove_column :organisations, :hub_restrictions_by_default + remove_column :referentials, :hub_restrictions + end +end diff --git a/db/migrate/20150129170104_add_organisation_id_rule_parameter_set.rb b/db/migrate/20150129170104_add_organisation_id_rule_parameter_set.rb new file mode 100644 index 000000000..8b3f52caf --- /dev/null +++ b/db/migrate/20150129170104_add_organisation_id_rule_parameter_set.rb @@ -0,0 +1,9 @@ +class AddOrganisationIdRuleParameterSet < ActiveRecord::Migration + def up + add_column :rule_parameter_sets, :organisation_id, :integer, :limit => 8 + end + + def down + remove_column :rule_parameter_sets, :organisation_id + end +end diff --git a/db/migrate/20150218175300_set_organisation_id_to_rps.rb b/db/migrate/20150218175300_set_organisation_id_to_rps.rb new file mode 100644 index 000000000..f7028449d --- /dev/null +++ b/db/migrate/20150218175300_set_organisation_id_to_rps.rb @@ -0,0 +1,19 @@ +class SetOrganisationIdToRps < ActiveRecord::Migration + #class RuleParameterSet < ActiveRecord::Base + #attr_accessor :referential_id + #attr_accessor :organisation_id + #attr_accessor :name + #end + #def up + #RuleParameterSet.all.each_with_index do |rps, index| + # rps.update_attributes :organisation_id => Referential.find( rps.referential_id).organisation_id, + # :name => "#{rps.name} #{index}" + #end + #end + + #def down + #RuleParameterSet.all.each_with_index do |rps, index| + # rps.update_attributes :organisation_id => nil + #end + #end +end diff --git a/db/migrate/20150219175300_insert_default_organisation.rb b/db/migrate/20150219175300_insert_default_organisation.rb new file mode 100644 index 000000000..d151c3800 --- /dev/null +++ b/db/migrate/20150219175300_insert_default_organisation.rb @@ -0,0 +1,21 @@ +class InsertDefaultOrganisation < ActiveRecord::Migration + # def up + # organisation = Organisation.find_or_create_by(:name => "Chouette") + # Referential.where( :organisation_id => nil).each do |r| + # r.update_attributes :organisation_id => organisation.id + # end + # User.where( :organisation_id => nil).each do |r| + # r.update_attributes :organisation_id => organisation.id + # end + # Organisation.all.each do |organisation| + # RuleParameterSet.default_for_all_modes( organisation).save if organisation.rule_parameter_sets.empty? + # end + + # end + + # def down + # organisations = Organisation.where( :name => "Chouette") + # organisations.first.destroy unless organisations.empty? + # end +end + diff --git a/db/migrate/20150219205300_remove_referential_id_to_rule_parameter_set.rb b/db/migrate/20150219205300_remove_referential_id_to_rule_parameter_set.rb new file mode 100644 index 000000000..747557ef0 --- /dev/null +++ b/db/migrate/20150219205300_remove_referential_id_to_rule_parameter_set.rb @@ -0,0 +1,9 @@ +class RemoveReferentialIdToRuleParameterSet < ActiveRecord::Migration + def up + remove_column :rule_parameter_sets, :referential_id + end + def down + add_column :rule_parameter_sets, :referential_id, :int + end +end + diff --git a/db/migrate/20150304084602_remove_hub_restrictions_from_referentials.rb b/db/migrate/20150304084602_remove_hub_restrictions_from_referentials.rb new file mode 100644 index 000000000..354203603 --- /dev/null +++ b/db/migrate/20150304084602_remove_hub_restrictions_from_referentials.rb @@ -0,0 +1,5 @@ +class RemoveHubRestrictionsFromReferentials < ActiveRecord::Migration + def change + remove_column :referentials, :hub_restrictions + end +end diff --git a/db/migrate/20150304084646_remove_hub_restrictions_by_default_from_organisations.rb b/db/migrate/20150304084646_remove_hub_restrictions_by_default_from_organisations.rb new file mode 100644 index 000000000..daa79707b --- /dev/null +++ b/db/migrate/20150304084646_remove_hub_restrictions_by_default_from_organisations.rb @@ -0,0 +1,5 @@ +class RemoveHubRestrictionsByDefaultFromOrganisations < ActiveRecord::Migration + def change + remove_column :organisations, :hub_restrictions_by_default + end +end diff --git a/db/migrate/20150304090707_add_data_format_to_referentials.rb b/db/migrate/20150304090707_add_data_format_to_referentials.rb new file mode 100644 index 000000000..5d5df65d5 --- /dev/null +++ b/db/migrate/20150304090707_add_data_format_to_referentials.rb @@ -0,0 +1,5 @@ +class AddDataFormatToReferentials < ActiveRecord::Migration + def change + add_column :referentials, :data_format, :string + end +end diff --git a/db/migrate/20150304090743_add_data_format_to_organisations.rb b/db/migrate/20150304090743_add_data_format_to_organisations.rb new file mode 100644 index 000000000..2222c0b08 --- /dev/null +++ b/db/migrate/20150304090743_add_data_format_to_organisations.rb @@ -0,0 +1,5 @@ +class AddDataFormatToOrganisations < ActiveRecord::Migration + def change + add_column :organisations, :data_format, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 5714242ae..b7feb13be 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: 20150226083920) do +ActiveRecord::Schema.define(version: 20150304090743) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -195,6 +195,19 @@ ActiveRecord::Schema.define(version: 20150226083920) do t.integer "choice_code" end + create_table "footnotes", force: true do |t| + t.integer "line_id", limit: 8 + t.string "code" + t.string "label" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "footnotes_vehicle_journeys", id: false, force: true do |t| + t.integer "vehicle_journey_id", limit: 8 + t.integer "footnote_id", limit: 8 + end + create_table "group_of_lines", force: true do |t| t.string "objectid", null: false t.integer "object_version" @@ -310,8 +323,9 @@ ActiveRecord::Schema.define(version: 20150226083920) do create_table "organisations", force: true do |t| t.string "name" - 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 "data_format" end create_table "pt_links", force: true do |t| @@ -342,6 +356,7 @@ ActiveRecord::Schema.define(version: 20150226083920) do t.text "geographical_bounds" t.integer "user_id", limit: 8 t.string "user_name" + t.string "data_format" end create_table "routes", force: true do |t| @@ -367,11 +382,11 @@ ActiveRecord::Schema.define(version: 20150226083920) do end create_table "rule_parameter_sets", force: true do |t| - t.integer "referential_id", limit: 8 t.text "parameters" t.string "name" - 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.integer "organisation_id", limit: 8 end create_table "stop_areas", force: true do |t| |
