diff options
| author | Luc Donnet | 2017-12-21 14:50:08 +0100 |
|---|---|---|
| committer | GitHub | 2017-12-21 14:50:08 +0100 |
| commit | 7aec5b94868bc2e7473f7ded4be7a585fb7b174e (patch) | |
| tree | 80218bcbec4d2740f6ca5be1d37bb0ba493cc879 /db/migrate | |
| parent | 9050a68f40829fc1b08e2f60c3eea9cf0c76e879 (diff) | |
| parent | 610a3e133b6405b32ce5d8aa48be075d4b137b4f (diff) | |
| download | chouette-core-7aec5b94868bc2e7473f7ded4be7a585fb7b174e.tar.bz2 | |
Merge pull request #150 from af83/5301-add_business_calendars
Refs #5301 First draft for Business Calendars
Diffstat (limited to 'db/migrate')
3 files changed, 32 insertions, 0 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 |
