diff --git a/db/migrate/20120101000001_create_base.rb b/db/migrate/20120101000001_create_base.rb index 586527349..481cd6c01 100644 --- a/db/migrate/20120101000001_create_base.rb +++ b/db/migrate/20120101000001_create_base.rb @@ -34,13 +34,13 @@ class CreateBase < ActiveRecord::Migration t.boolean :verified, null: false, default: false t.boolean :active, null: false, default: true t.string :note, limit: 250, null: true, default: '' - t.timestamp :last_login, null: true + t.timestamp :last_login, limit: 3, null: true t.string :source, limit: 200, null: true t.integer :login_failed, null: false, default: 0 t.string :preferences, limit: 8000, null: true t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :users, [:login], unique: true add_index :users, [:email] @@ -61,7 +61,7 @@ class CreateBase < ActiveRecord::Migration t.string :note, limit: 250, null: true t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :signatures, [:name], unique: true @@ -74,7 +74,7 @@ class CreateBase < ActiveRecord::Migration t.string :preferences, limit: 2000, null: true t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :email_addresses, [:email], unique: true @@ -89,7 +89,7 @@ class CreateBase < ActiveRecord::Migration t.string :note, limit: 250, null: true t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :groups, [:name], unique: true @@ -101,15 +101,15 @@ class CreateBase < ActiveRecord::Migration t.string :note, limit: 250, null: true t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :roles, [:name], unique: true create_table :permissions do |t| - t.string :name, limit: 255, null: false - t.string :note, limit: 500, null: true - t.string :preferences, limit: 10_000, null: true - t.timestamps + t.string :name, limit: 255, null: false + t.string :note, limit: 500, null: true + t.string :preferences, limit: 10_000, null: true + t.timestamps limit: 3, null: false end add_index :permissions, [:name], unique: true @@ -125,7 +125,7 @@ class CreateBase < ActiveRecord::Migration t.string :note, limit: 250, null: true, default: '' t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :organizations, [:name], unique: true @@ -157,7 +157,7 @@ class CreateBase < ActiveRecord::Migration t.string :secret, limit: 250, null: true t.string :username, limit: 250, null: true t.references :user, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :authorizations, [:uid, :provider] add_index :authorizations, [:user_id] @@ -168,7 +168,7 @@ class CreateBase < ActiveRecord::Migration t.string :alias, limit: 20, null: true t.string :name, limit: 255, null: false t.boolean :active, null: false, default: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :locales, [:locale], unique: true add_index :locales, [:name], unique: true @@ -181,20 +181,20 @@ class CreateBase < ActiveRecord::Migration t.string :format, limit: 20, null: false, default: 'string' t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :translations, [:source], length: 255 add_index :translations, [:locale] create_table :object_lookups do |t| t.string :name, limit: 250, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :object_lookups, [:name], unique: true create_table :type_lookups do |t| t.string :name, limit: 250, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :type_lookups, [:name], unique: true @@ -205,9 +205,9 @@ class CreateBase < ActiveRecord::Migration t.string :action, limit: 40, null: false t.string :label, limit: 255, null: true t.text :preferences, limit: 500.kilobytes + 1, null: true - t.timestamp :last_used_at, null: true + t.timestamp :last_used_at, limit: 3, null: true t.date :expires_at, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :tokens, :user_id add_index :tokens, [:name, :action], unique: true @@ -221,12 +221,12 @@ class CreateBase < ActiveRecord::Migration t.string :state, limit: 50, null: false t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end create_table :package_migrations do |t| t.string :name, limit: 250, null: false t.string :version, limit: 250, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end create_table :taskbars do |t| @@ -235,12 +235,12 @@ class CreateBase < ActiveRecord::Migration t.string :client_id, null: false t.string :key, limit: 100, null: false t.string :callback, limit: 100, null: false - t.column :state, :text, limit: 2.megabytes + 1, null: true + t.text :state, limit: 2.megabytes + 1, null: true t.string :params, limit: 2000, null: true t.integer :prio, null: false t.boolean :notify, null: false, default: false t.boolean :active, null: false, default: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :taskbars, [:user_id] add_index :taskbars, [:client_id] @@ -250,21 +250,21 @@ class CreateBase < ActiveRecord::Migration t.references :tag_object, null: false t.integer :o_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :tags, [:o_id] add_index :tags, [:tag_object_id] create_table :tag_objects do |t| t.string :name, limit: 250, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :tag_objects, [:name], unique: true create_table :tag_items do |t| t.string :name, limit: 250, null: false t.string :name_downcase, limit: 250, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :tag_items, [:name_downcase] @@ -272,7 +272,7 @@ class CreateBase < ActiveRecord::Migration t.references :recent_view_object, null: false t.integer :o_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :recent_views, [:o_id] add_index :recent_views, [:created_by_id] @@ -286,7 +286,7 @@ class CreateBase < ActiveRecord::Migration t.references :group, null: true t.integer :o_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :activity_streams, [:o_id] add_index :activity_streams, [:created_by_id] @@ -308,7 +308,7 @@ class CreateBase < ActiveRecord::Migration t.string :value_from, limit: 500, null: true t.string :value_to, limit: 500, null: true t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :histories, [:o_id] add_index :histories, [:created_by_id] @@ -323,20 +323,20 @@ class CreateBase < ActiveRecord::Migration create_table :history_types do |t| t.string :name, limit: 250, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :history_types, [:name], unique: true create_table :history_objects do |t| t.string :name, limit: 250, null: false t.string :note, limit: 250, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :history_objects, [:name], unique: true create_table :history_attributes do |t| t.string :name, limit: 250, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :history_attributes, [:name], unique: true @@ -350,7 +350,7 @@ class CreateBase < ActiveRecord::Migration t.string :state_initial, limit: 2000, null: true t.boolean :frontend, null: false t.text :preferences, limit: 200.kilobytes + 1, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :settings, [:name], unique: true add_index :settings, [:area] @@ -364,21 +364,21 @@ class CreateBase < ActiveRecord::Migration t.string :size, limit: 50, null: true t.string :filename, limit: 250, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :stores, [:store_object_id, :o_id] create_table :store_objects do |t| t.string :name, limit: 250, null: false t.string :note, limit: 250, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :store_objects, [:name], unique: true create_table :store_files do |t| t.string :sha, limit: 128, null: false t.string :provider, limit: 20, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :store_files, [:sha], unique: true add_index :store_files, [:provider] @@ -386,7 +386,7 @@ class CreateBase < ActiveRecord::Migration create_table :store_provider_dbs do |t| t.string :sha, limit: 128, null: false t.binary :data, limit: 200.megabytes, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :store_provider_dbs, [:sha], unique: true @@ -403,7 +403,7 @@ class CreateBase < ActiveRecord::Migration t.string :source_url, limit: 512, null: true t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :avatars, [:o_id, :object_lookup_id] add_index :avatars, [:store_hash] @@ -418,7 +418,7 @@ class CreateBase < ActiveRecord::Migration t.boolean :seen, null: false, default: false t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :online_notifications, [:user_id] add_index :online_notifications, [:seen] @@ -426,33 +426,33 @@ class CreateBase < ActiveRecord::Migration add_index :online_notifications, [:updated_at] create_table :schedulers do |t| - t.column :name, :string, limit: 250, null: false - t.column :method, :string, limit: 250, null: false - t.column :period, :integer, null: true - t.column :running, :integer, null: false, default: false - t.column :last_run, :timestamp, null: true - t.column :prio, :integer, null: false - t.column :pid, :string, limit: 250, null: true - t.column :note, :string, limit: 250, null: true - t.column :active, :boolean, null: false, default: false - t.column :updated_by_id, :integer, null: false - t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.string :name, limit: 250, null: false + t.string :method, limit: 250, null: false + t.integer :period, null: true + t.integer :running, null: false, default: false + t.timestamp :last_run, limit: 3, null: true + t.integer :prio, null: false + t.string :pid, limit: 250, null: true + t.string :note, limit: 250, null: true + t.boolean :active, null: false, default: false + t.integer :updated_by_id, null: false + t.integer :created_by_id, null: false + t.timestamps limit: 3, null: false end add_index :schedulers, [:name], unique: true create_table :calendars do |t| - t.string :name, limit: 250, null: true - t.string :timezone, limit: 250, null: true + t.string :name, limit: 250, null: true + t.string :timezone, limit: 250, 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.boolean :default, null: false, default: false + t.string :ical_url, limit: 500, null: true t.text :public_holidays, limit: 500.kilobytes + 1, null: true t.text :last_log, limit: 500.kilobytes + 1, null: true - t.timestamp :last_sync, null: true - t.integer :updated_by_id, null: false - t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamp :last_sync, limit: 3, null: true + t.integer :updated_by_id, null: false + t.integer :created_by_id, null: false + t.timestamps limit: 3, null: false end add_index :calendars, [:name], unique: true @@ -467,7 +467,7 @@ class CreateBase < ActiveRecord::Migration t.string :fingerprint, limit: 160, null: true t.string :user_agent, limit: 250, null: true t.string :ip, limit: 160, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :user_devices, [:user_id] add_index :user_devices, [:os, :browser, :location] @@ -478,27 +478,27 @@ class CreateBase < ActiveRecord::Migration create_table :external_credentials do |t| t.string :name t.string :credentials, limit: 2500, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end create_table :object_manager_attributes do |t| - t.references :object_lookup, null: false - t.column :name, :string, limit: 200, null: false - t.column :display, :string, limit: 200, null: false - t.column :data_type, :string, limit: 100, null: false - t.column :data_option, :string, limit: 8000, null: true - t.column :data_option_new, :string, limit: 8000, null: true - t.column :editable, :boolean, null: false, default: true - t.column :active, :boolean, null: false, default: true - t.column :screens, :string, limit: 2000, null: true - t.column :to_create, :boolean, null: false, default: false - t.column :to_migrate, :boolean, null: false, default: false - t.column :to_delete, :boolean, null: false, default: false - t.column :to_config, :boolean, null: false, default: false - t.column :position, :integer, null: false - t.column :created_by_id, :integer, null: false - t.column :updated_by_id, :integer, null: false - t.timestamps null: false + t.references :object_lookup, null: false + t.string :name, limit: 200, null: false + t.string :display, limit: 200, null: false + t.string :data_type, limit: 100, null: false + t.string :data_option, limit: 8000, null: true + t.string :data_option_new, limit: 8000, null: true + t.boolean :editable, null: false, default: true + t.boolean :active, null: false, default: true + t.string :screens, limit: 2000, null: true + t.boolean :to_create, null: false, default: false + t.boolean :to_migrate, null: false, default: false + t.boolean :to_delete, null: false, default: false + t.boolean :to_config, null: false, default: false + t.integer :position, null: false + t.integer :created_by_id, null: false + t.integer :updated_by_id, null: false + t.timestamps limit: 3, null: false end add_index :object_manager_attributes, [:object_lookup_id, :name], unique: true add_index :object_manager_attributes, [:object_lookup_id] @@ -513,7 +513,7 @@ class CreateBase < ActiveRecord::Migration t.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) t.string :locked_by # Who is working on this object (if locked) t.string :queue # The name of the queue this job is in - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :delayed_jobs, [:priority, :run_at], name: 'delayed_jobs_priority' diff --git a/db/migrate/20120101000010_create_ticket.rb b/db/migrate/20120101000010_create_ticket.rb index 612dfab03..4a2acc4fa 100644 --- a/db/migrate/20120101000010_create_ticket.rb +++ b/db/migrate/20120101000010_create_ticket.rb @@ -5,7 +5,7 @@ class CreateTicket < ActiveRecord::Migration t.column :note, :string, limit: 250, null: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :ticket_state_types, [:name], unique: true @@ -18,7 +18,7 @@ class CreateTicket < ActiveRecord::Migration t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :ticket_states, [:name], unique: true @@ -28,7 +28,7 @@ class CreateTicket < ActiveRecord::Migration t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :ticket_priorities, [:name], unique: true create_table :tickets do |t| @@ -36,38 +36,38 @@ class CreateTicket < ActiveRecord::Migration t.references :priority, null: false t.references :state, null: false t.references :organization, null: true - t.column :number, :string, limit: 60, null: false - t.column :title, :string, limit: 250, null: false + t.column :number, :string, limit: 60, null: false + t.column :title, :string, limit: 250, null: false t.column :owner_id, :integer, null: false t.column :customer_id, :integer, null: false - t.column :note, :string, limit: 250, null: true - t.column :first_response, :timestamp, null: true - t.column :first_response_escal_date, :timestamp, null: true - t.column :first_response_sla_time, :timestamp, null: true + t.column :note, :string, limit: 250, null: true + t.column :first_response, :timestamp, limit: 3, null: true + t.column :first_response_escal_date, :timestamp, limit: 3, null: true + t.column :first_response_sla_time, :timestamp, limit: 3, null: true t.column :first_response_in_min, :integer, null: true t.column :first_response_diff_in_min, :integer, null: true - t.column :close_time, :timestamp, null: true - t.column :close_time_escal_date, :timestamp, null: true - t.column :close_time_sla_time, :timestamp, null: true + t.column :close_time, :timestamp, limit: 3, null: true + t.column :close_time_escal_date, :timestamp, limit: 3, null: true + t.column :close_time_sla_time, :timestamp, limit: 3, null: true t.column :close_time_in_min, :integer, null: true t.column :close_time_diff_in_min, :integer, null: true - t.column :update_time_escal_date, :timestamp, null: true - t.column :update_time_sla_time, :timestamp, null: true + t.column :update_time_escal_date, :timestamp, limit: 3, null: true + t.column :update_time_sla_time, :timestamp, limit: 3, null: true t.column :update_time_in_min, :integer, null: true t.column :update_time_diff_in_min, :integer, null: true - t.column :last_contact, :timestamp, null: true - t.column :last_contact_agent, :timestamp, null: true - t.column :last_contact_customer, :timestamp, null: true + t.column :last_contact, :timestamp, limit: 3, null: true + t.column :last_contact_agent, :timestamp, limit: 3, null: true + t.column :last_contact_customer, :timestamp, limit: 3, null: true t.column :create_article_type_id, :integer, null: true t.column :create_article_sender_id, :integer, null: true t.column :article_count, :integer, null: true - t.column :escalation_time, :timestamp, null: true - t.column :pending_time, :timestamp, null: true - t.column :type, :string, limit: 100, null: true - t.column :preferences, :text, limit: 500.kilobytes + 1, null: true + t.column :escalation_time, :timestamp, limit: 3, null: true + t.column :pending_time, :timestamp, limit: 3, null: true + t.column :type, :string, limit: 100, null: true + t.column :preferences, :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 null: false + t.timestamps limit: 3, null: false end add_index :tickets, [:state_id] add_index :tickets, [:priority_id] @@ -102,7 +102,7 @@ class CreateTicket < ActiveRecord::Migration t.column :key, :string, limit: 50, null: false t.column :value, :string, limit: 50, null: true t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :ticket_flags, [:tickets_id, :created_by_id] add_index :ticket_flags, [:tickets_id, :key] @@ -114,7 +114,7 @@ class CreateTicket < ActiveRecord::Migration t.references :ticket_articles, null: true t.column :time_unit, :decimal, precision: 6, scale: 2, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :ticket_time_accounting, [:tickets_id] add_index :ticket_time_accounting, [:ticket_articles_id] @@ -127,7 +127,7 @@ class CreateTicket < ActiveRecord::Migration t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :ticket_article_types, [:name], unique: true @@ -136,7 +136,7 @@ class CreateTicket < ActiveRecord::Migration t.column :note, :string, limit: 250, null: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :ticket_article_senders, [:name], unique: true @@ -159,7 +159,7 @@ class CreateTicket < ActiveRecord::Migration t.column :preferences, :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 null: false + t.timestamps limit: 3, null: false end add_index :ticket_articles, [:ticket_id] add_index :ticket_articles, [:message_id_md5] @@ -175,7 +175,7 @@ class CreateTicket < ActiveRecord::Migration t.column :key, :string, limit: 50, null: false t.column :value, :string, limit: 50, null: true t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :ticket_article_flags, [:ticket_articles_id, :created_by_id], name: 'index_ticket_article_flags_on_articles_id_and_created_by_id' add_index :ticket_article_flags, [:ticket_articles_id, :key] @@ -201,7 +201,7 @@ class CreateTicket < ActiveRecord::Migration t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :overviews, [:name] @@ -228,7 +228,7 @@ class CreateTicket < ActiveRecord::Migration t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :triggers, [:name], unique: true @@ -238,17 +238,17 @@ class CreateTicket < ActiveRecord::Migration t.column :condition, :string, limit: 2500, null: false t.column :perform, :string, limit: 2500, null: false t.column :disable_notification, :boolean, null: false, default: true - t.column :last_run_at, :timestamp, null: true - t.column :next_run_at, :timestamp, null: true + t.column :last_run_at, :timestamp, limit: 3, null: true + t.column :next_run_at, :timestamp, limit: 3, null: true t.column :running, :boolean, null: false, default: false t.column :processed, :integer, null: false, default: 0 t.column :matching, :integer, null: false - t.column :pid, :string, limit: 250, null: true - t.column :note, :string, limit: 250, null: true + t.column :pid, :string, limit: 250, null: true + t.column :note, :string, limit: 250, null: true t.column :active, :boolean, null: false, default: false t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :jobs, [:name], unique: true @@ -258,14 +258,14 @@ class CreateTicket < ActiveRecord::Migration t.column :content_type, :string, limit: 250, null: false t.column :active, :boolean, null: false, default: true t.column :note, :string, limit: 250, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end create_table :link_types do |t| t.column :name, :string, limit: 250, null: false t.column :note, :string, limit: 250, null: true t.column :active, :boolean, null: false, default: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :link_types, [:name], unique: true @@ -273,7 +273,7 @@ class CreateTicket < ActiveRecord::Migration t.column :name, :string, limit: 250, null: false t.column :note, :string, limit: 250, null: true t.column :active, :boolean, null: false, default: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :link_objects, [:name], unique: true @@ -283,7 +283,7 @@ class CreateTicket < ActiveRecord::Migration t.column :link_object_source_value, :integer, null: false t.column :link_object_target_id, :integer, null: false t.column :link_object_target_value, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :links, [:link_object_source_id, :link_object_source_value, :link_object_target_id, :link_object_target_value, :link_type_id], unique: true, name: 'links_uniq_total' @@ -296,7 +296,7 @@ class CreateTicket < ActiveRecord::Migration t.column :note, :string, limit: 250, null: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :postmaster_filters, [:channel] @@ -307,10 +307,10 @@ class CreateTicket < ActiveRecord::Migration t.column :content, :text, limit: 10.megabytes + 1, null: false t.column :note, :string, limit: 250, null: true t.column :active, :boolean, null: false, default: true - t.column :foreign_id, :integer, null: true + t.column :foreign_id, :integer, null: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :text_modules, [:user_id] add_index :text_modules, [:name] @@ -328,7 +328,7 @@ class CreateTicket < ActiveRecord::Migration t.column :options, :string, limit: 2500, null: false t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :templates, [:user_id] add_index :templates, [:name] @@ -345,14 +345,14 @@ class CreateTicket < ActiveRecord::Migration t.column :area, :string, limit: 100, null: false t.column :options, :text, limit: 500.kilobytes + 1, null: true t.column :active, :boolean, null: false, default: true - t.column :preferences, :string, limit: 2000, null: true + t.column :preferences, :string, limit: 2000, null: true t.column :last_log_in, :text, limit: 500.kilobytes + 1, null: true t.column :last_log_out, :text, limit: 500.kilobytes + 1, null: true - t.column :status_in, :string, limit: 100, null: true - t.column :status_out, :string, limit: 100, null: true + t.column :status_in, :string, limit: 100, null: true + t.column :status_out, :string, limit: 100, null: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :channels, [:area] @@ -365,7 +365,7 @@ class CreateTicket < ActiveRecord::Migration t.column :condition, :string, limit: 5000, null: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :slas, [:name], unique: true @@ -376,7 +376,7 @@ class CreateTicket < ActiveRecord::Migration t.string :note, limit: 250, null: true t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :macros, [:name], unique: true @@ -389,7 +389,7 @@ class CreateTicket < ActiveRecord::Migration t.string :preferences, limit: 5000, null: true t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :chats, [:name], unique: true @@ -399,7 +399,7 @@ class CreateTicket < ActiveRecord::Migration t.string :note, limit: 250, null: true t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :chat_topics, [:name], unique: true @@ -412,7 +412,7 @@ class CreateTicket < ActiveRecord::Migration t.text :preferences, limit: 100.kilobytes + 1, null: true t.integer :updated_by_id, null: true t.integer :created_by_id, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :chat_sessions, [:session_id] add_index :chat_sessions, [:state] @@ -423,7 +423,7 @@ class CreateTicket < ActiveRecord::Migration t.integer :chat_session_id, null: false t.string :content, limit: 5000, null: false t.integer :created_by_id, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :chat_messages, [:chat_session_id] @@ -432,7 +432,7 @@ class CreateTicket < ActiveRecord::Migration t.integer :concurrent, null: false, default: 5 t.integer :updated_by_id, null: false t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :chat_agents, [:active] add_index :chat_agents, [:updated_by_id], unique: true @@ -444,7 +444,7 @@ class CreateTicket < ActiveRecord::Migration t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :report_profiles, [:name], unique: true diff --git a/db/migrate/20120101000020_create_network.rb b/db/migrate/20120101000020_create_network.rb index 764c5a43f..39c253342 100644 --- a/db/migrate/20120101000020_create_network.rb +++ b/db/migrate/20120101000020_create_network.rb @@ -6,7 +6,7 @@ class CreateNetwork < ActiveRecord::Migration t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :networks, [:name], unique: true @@ -16,7 +16,7 @@ class CreateNetwork < ActiveRecord::Migration t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :network_category_types, [:name], unique: true @@ -25,7 +25,7 @@ class CreateNetwork < ActiveRecord::Migration t.column :key, :string, limit: 250, null: false t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :network_privacies, [:name], unique: true @@ -39,7 +39,7 @@ class CreateNetwork < ActiveRecord::Migration t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :network_categories, [:network_id] @@ -63,7 +63,7 @@ class CreateNetwork < ActiveRecord::Migration t.column :body, :string, limit: 20_000, null: false t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :network_item_comments, [:network_item_id] @@ -71,7 +71,7 @@ class CreateNetwork < ActiveRecord::Migration t.references :network_item, null: false t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :network_item_plus, [:network_item_id, :created_by_id], unique: true @@ -79,7 +79,7 @@ class CreateNetwork < ActiveRecord::Migration t.references :network_categories, null: false t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :network_category_subscriptions, [:network_categories_id, :created_by_id], unique: true, name: 'index_network_category_subscriptions_on_network_c_i_and_c' @@ -87,7 +87,7 @@ class CreateNetwork < ActiveRecord::Migration t.references :network_item, null: false t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :network_item_subscriptions, [:network_item_id, :created_by_id], unique: true, name: 'index_network_item_subscriptions_on_item_id_and_created_by_id' diff --git a/db/migrate/20150967000001_create_stats_store.rb b/db/migrate/20150967000001_create_stats_store.rb index b330dcabb..da91cc369 100644 --- a/db/migrate/20150967000001_create_stats_store.rb +++ b/db/migrate/20150967000001_create_stats_store.rb @@ -8,7 +8,7 @@ class CreateStatsStore < ActiveRecord::Migration t.integer :related_stats_store_object_id, null: true t.string :data, limit: 2500, null: true t.integer :created_by_id, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :stats_stores, [:o_id] add_index :stats_stores, [:key] diff --git a/db/migrate/20160316000006_renew_triggers.rb b/db/migrate/20160316000006_renew_triggers.rb index 5469f2d1e..760d3bdef 100644 --- a/db/migrate/20160316000006_renew_triggers.rb +++ b/db/migrate/20160316000006_renew_triggers.rb @@ -10,7 +10,7 @@ class RenewTriggers < ActiveRecord::Migration t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :triggers, [:name], unique: true @@ -31,7 +31,7 @@ class RenewTriggers < ActiveRecord::Migration t.column :active, :boolean, null: false, default: false t.column :updated_by_id, :integer, null: false t.column :created_by_id, :integer, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :jobs, [:name], unique: true diff --git a/db/migrate/20160417000002_add_http_log.rb b/db/migrate/20160417000002_add_http_log.rb index 8480981ef..4fb47729f 100644 --- a/db/migrate/20160417000002_add_http_log.rb +++ b/db/migrate/20160417000002_add_http_log.rb @@ -12,7 +12,7 @@ class AddHttpLog < ActiveRecord::Migration t.column :response, :string, limit: 10_000, null: false t.column :updated_by_id, :integer, null: true t.column :created_by_id, :integer, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :http_logs, [:facility] add_index :http_logs, [:created_by_id] diff --git a/db/migrate/20160422000003_create_cti_log.rb b/db/migrate/20160422000003_create_cti_log.rb index 85b75aa77..9f0f5dd63 100644 --- a/db/migrate/20160422000003_create_cti_log.rb +++ b/db/migrate/20160422000003_create_cti_log.rb @@ -9,11 +9,11 @@ class CreateCtiLog < ActiveRecord::Migration t.string :to_comment, limit: 250, null: true t.string :call_id, limit: 250, null: false t.string :comment, limit: 500, null: true - t.timestamp :start, null: true - t.timestamp :end, null: true + t.timestamp :start, limit: 3, null: true + t.timestamp :end, limit: 3, null: true t.boolean :done, null: false, default: true t.text :preferences, limit: 500.kilobytes + 1, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :cti_logs, [:call_id], unique: true add_index :cti_logs, [:direction] @@ -27,7 +27,7 @@ class CreateCtiLog < ActiveRecord::Migration t.integer :o_id, null: false t.integer :user_id, null: true t.text :preferences, limit: 500.kilobytes + 1, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :cti_caller_ids, [:caller_id] add_index :cti_caller_ids, [:caller_id, :level] diff --git a/db/migrate/20160424000002_create_external_sync.rb b/db/migrate/20160424000002_create_external_sync.rb index 03ae0ce85..566c72035 100644 --- a/db/migrate/20160424000002_create_external_sync.rb +++ b/db/migrate/20160424000002_create_external_sync.rb @@ -6,7 +6,7 @@ class CreateExternalSync < ActiveRecord::Migration t.string :object, limit: 100, null: false t.integer :o_id, null: false t.text :last_payload, limit: 500.kilobytes + 1, null: true - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :external_syncs, [:source, :source_id], unique: true add_index :external_syncs, [:source, :source_id, :object, :o_id], name: 'index_external_syncs_on_source_and_source_id_and_object_o_id' diff --git a/db/migrate/20160704000001_add_karma.rb b/db/migrate/20160704000001_add_karma.rb index bbc2df934..9a1e82bf8 100644 --- a/db/migrate/20160704000001_add_karma.rb +++ b/db/migrate/20160704000001_add_karma.rb @@ -5,16 +5,16 @@ class AddKarma < ActiveRecord::Migration t.integer :user_id, null: false t.integer :score, null: false t.string :level, limit: 200, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :karma_users, [:user_id], unique: true create_table :karma_activities do |t| - t.column :name, :string, limit: 200, null: false - t.column :description, :string, limit: 200, null: false - t.column :score, :integer, null: false - t.column :once_ttl, :integer, null: false - t.timestamps null: false + t.string :name, limit: 200, null: false + t.string :description, limit: 200, null: false + t.integer :score, null: false + t.integer :once_ttl, null: false + t.timestamps limit: 3, null: false end add_index :karma_activities, [:name], unique: true Karma::Activity.create_or_update( @@ -91,7 +91,7 @@ class AddKarma < ActiveRecord::Migration t.integer :activity_id, null: false t.integer :score, null: false t.integer :score_total, null: false - t.timestamps null: false + t.timestamps limit: 3, null: false end add_index :karma_activity_logs, [:user_id] add_index :karma_activity_logs, [:created_at] diff --git a/db/migrate/20160805000001_add_permission.rb b/db/migrate/20160805000001_add_permission.rb index 67f6a49a8..abbb211b2 100644 --- a/db/migrate/20160805000001_add_permission.rb +++ b/db/migrate/20160805000001_add_permission.rb @@ -8,7 +8,7 @@ class AddPermission < ActiveRecord::Migration t.string :name, limit: 255, null: false t.string :note, limit: 500, null: true t.string :preferences, limit: 10_000, null: true - t.timestamps + t.timestamps limit: 3, null: false end add_index :permissions, [:name], unique: true diff --git a/db/migrate/20160830000001_token_attributes.rb b/db/migrate/20160830000001_token_attributes.rb index b29d6d135..ea8f89eeb 100644 --- a/db/migrate/20160830000001_token_attributes.rb +++ b/db/migrate/20160830000001_token_attributes.rb @@ -3,7 +3,7 @@ class TokenAttributes < ActiveRecord::Migration # return if it's a new setup return if !Setting.find_by(name: 'system_init_done') - add_column :tokens, :last_used_at, :datetime, null: true + add_column :tokens, :last_used_at, :timestamp, limit: 3, null: true add_column :tokens, :expires_at, :date, null: true end end