From 8d28be378ab72b5fd8e5747c43c58934a408d1fd Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 19 Jul 2016 22:15:49 +0200 Subject: [PATCH] Increased size for business_hours. --- db/migrate/20120101000001_create_base.rb | 2 +- db/migrate/20160719000001_update_calendars.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20160719000001_update_calendars.rb diff --git a/db/migrate/20120101000001_create_base.rb b/db/migrate/20120101000001_create_base.rb index 88a0749fb..2e57b1d2f 100644 --- a/db/migrate/20120101000001_create_base.rb +++ b/db/migrate/20120101000001_create_base.rb @@ -425,7 +425,7 @@ class CreateBase < ActiveRecord::Migration create_table :calendars do |t| t.string :name, limit: 250, null: true t.string :timezone, limit: 250, null: true - t.string :business_hours, limit: 1200, null: true + t.string :business_hours, limit: 3000, null: true t.boolean :default, null: false, default: false t.string :ical_url, limit: 500, null: true t.text :public_holidays, limit: 500.kilobytes + 1, null: true diff --git a/db/migrate/20160719000001_update_calendars.rb b/db/migrate/20160719000001_update_calendars.rb new file mode 100644 index 000000000..cf6f206c5 --- /dev/null +++ b/db/migrate/20160719000001_update_calendars.rb @@ -0,0 +1,9 @@ + +class UpdateCalendars < ActiveRecord::Migration + def up + # return if it's a new setup + return if !Setting.find_by(name: 'system_init_done') + + change_column :calendars, :business_hours, :string, limit: 3000, null: true + end +end