Fixed issue#432 - Unable to create job/scheduler if many time options are selected.

This commit is contained in:
Martin Edenhofer 2016-11-17 09:56:43 +01:00
parent fbbf19800e
commit cd986ee57c
3 changed files with 100 additions and 56 deletions

View file

@ -577,7 +577,7 @@ class CreateBase < ActiveRecord::Migration
t.string :key, limit: 250, null: true
t.integer :related_o_id, null: true
t.integer :related_stats_store_object_id, null: true
t.string :data, limit: 2500, null: true
t.string :data, limit: 5000, null: true
t.integer :created_by_id, null: false
t.timestamps limit: 3, null: false
end

View file

@ -190,7 +190,7 @@ class CreateTicket < ActiveRecord::Migration
t.column :name, :string, limit: 250, null: false
t.column :link, :string, limit: 250, null: false
t.column :prio, :integer, null: false
t.column :condition, :string, limit: 2500, null: false
t.column :condition, :text, limit: 500.kilobytes + 1, null: false
t.column :order, :string, limit: 2500, null: false
t.column :group_by, :string, limit: 250, null: true
t.column :organization_shared, :boolean, null: false, default: false
@ -218,8 +218,8 @@ class CreateTicket < ActiveRecord::Migration
create_table :triggers do |t|
t.column :name, :string, limit: 250, null: false
t.column :condition, :string, limit: 2500, null: false
t.column :perform, :string, limit: 2500, null: false
t.column :condition, :text, limit: 500.kilobytes + 1, null: false
t.column :perform, :text, limit: 500.kilobytes + 1, null: false
t.column :disable_notification, :boolean, null: false, default: true
t.column :note, :string, limit: 250, null: true
t.column :active, :boolean, null: false, default: true
@ -231,9 +231,9 @@ class CreateTicket < ActiveRecord::Migration
create_table :jobs do |t|
t.column :name, :string, limit: 250, null: false
t.column :timeplan, :string, limit: 1000, null: false
t.column :condition, :string, limit: 2500, null: false
t.column :perform, :string, limit: 2500, null: false
t.column :timeplan, :string, limit: 2500, null: false
t.column :condition, :text, limit: 500.kilobytes + 1, null: false
t.column :perform, :text, limit: 500.kilobytes + 1, null: false
t.column :disable_notification, :boolean, null: false, default: true
t.column :last_run_at, :timestamp, limit: 3, null: true
t.column :next_run_at, :timestamp, limit: 3, null: true
@ -287,8 +287,8 @@ class CreateTicket < ActiveRecord::Migration
create_table :postmaster_filters do |t|
t.column :name, :string, limit: 250, null: false
t.column :channel, :string, limit: 250, null: false
t.column :match, :string, limit: 5000, null: false
t.column :perform, :string, limit: 5000, null: false
t.column :match, :text, limit: 500.kilobytes + 1, null: false
t.column :perform, :text, limit: 500.kilobytes + 1, null: false
t.column :active, :boolean, null: false, default: true
t.column :note, :string, limit: 250, null: true
t.column :updated_by_id, :integer, null: false
@ -359,7 +359,7 @@ class CreateTicket < ActiveRecord::Migration
t.column :first_response_time, :integer, null: true
t.column :update_time, :integer, null: true
t.column :solution_time, :integer, null: true
t.column :condition, :string, limit: 5000, null: true
t.column :condition, :text, limit: 500.kilobytes + 1, null: true
t.column :updated_by_id, :integer, null: false
t.column :created_by_id, :integer, null: false
t.timestamps limit: 3, null: false
@ -368,7 +368,7 @@ class CreateTicket < ActiveRecord::Migration
create_table :macros do |t|
t.string :name, limit: 250, null: true
t.string :perform, limit: 5000, null: false
t.text :perform, limit: 500.kilobytes + 1, null: false
t.boolean :active, null: false, default: true
t.string :note, limit: 250, null: true
t.integer :updated_by_id, null: false
@ -437,7 +437,7 @@ class CreateTicket < ActiveRecord::Migration
create_table :report_profiles do |t|
t.column :name, :string, limit: 150, null: true
t.column :condition, :string, limit: 6000, null: true
t.column :condition, :text, limit: 500.kilobytes + 1, null: true
t.column :active, :boolean, null: false, default: true
t.column :updated_by_id, :integer, null: false
t.column :created_by_id, :integer, null: false

View file

@ -0,0 +1,44 @@
class JobUnableToCreateIssue432 < ActiveRecord::Migration
def up
# return if it's a new setup
return if !Setting.find_by(name: 'system_init_done')
ActiveRecord::Migration.change_table :jobs do |t|
t.change :timeplan, :string, limit: 2500
t.change :condition, :text, limit: 500.kilobytes + 1
t.change :perform, :text, limit: 500.kilobytes + 1
end
ActiveRecord::Migration.change_table :triggers do |t|
t.change :condition, :text, limit: 500.kilobytes + 1
t.change :perform, :text, limit: 500.kilobytes + 1
end
ActiveRecord::Migration.change_table :overviews do |t|
t.change :condition, :text, limit: 500.kilobytes + 1
end
ActiveRecord::Migration.change_table :report_profiles do |t|
t.change :condition, :text, limit: 500.kilobytes + 1
end
ActiveRecord::Migration.change_table :slas do |t|
t.change :condition, :text, limit: 500.kilobytes + 1
end
ActiveRecord::Migration.change_table :macros do |t|
t.change :perform, :text, limit: 500.kilobytes + 1
end
ActiveRecord::Migration.change_table :postmaster_filters do |t|
t.change :match, :text, limit: 500.kilobytes + 1
t.change :perform, :text, limit: 500.kilobytes + 1
end
ActiveRecord::Migration.change_table :stats_stores do |t|
t.change :data, :string, limit: 5000
end
Cache.clear
end
end