Prepared for rails 5.

This commit is contained in:
Martin Edenhofer 2015-09-27 23:34:21 +02:00
parent 0ecf07ff74
commit 455c23799d
7 changed files with 143 additions and 143 deletions

View file

@ -2,10 +2,10 @@ class CreateBase < ActiveRecord::Migration
def up
create_table :sessions do |t|
t.string :session_id, null: false
t.string :session_id, null: false
t.boolean :persistent, null: true
t.text :data
t.timestamps
t.timestamps null: false
end
add_index :sessions, :session_id
add_index :sessions, :updated_at
@ -40,7 +40,7 @@ class CreateBase < ActiveRecord::Migration
t.string :preferences, limit: 8000, null: true
t.integer :updated_by_id, null: false
t.integer :created_by_id, null: false
t.timestamps
t.timestamps 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
t.timestamps null: false
end
add_index :signatures, [:name], unique: true
@ -72,7 +72,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
t.timestamps null: false
end
add_index :email_addresses, [:email], unique: true
@ -87,7 +87,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
t.timestamps null: false
end
add_index :groups, [:name], unique: true
@ -97,7 +97,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
t.timestamps null: false
end
add_index :roles, [:name], unique: true
@ -108,7 +108,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
t.timestamps null: false
end
add_index :organizations, [:name], unique: true
@ -140,7 +140,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
t.timestamps null: false
end
add_index :authorizations, [:uid, :provider]
add_index :authorizations, [:user_id]
@ -151,7 +151,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
t.timestamps null: false
end
add_index :locales, [:locale], unique: true
add_index :locales, [:name], unique: true
@ -162,22 +162,22 @@ class CreateBase < ActiveRecord::Migration
t.string :target, limit: 255, null: false
t.string :target_initial, limit: 255, null: false
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
t.integer :updated_by_id, null: false
t.integer :created_by_id, null: false
t.timestamps null: false
end
add_index :translations, [:source]
add_index :translations, [:locale]
create_table :object_lookups do |t|
t.string :name, limit: 250, null: false
t.timestamps
t.timestamps 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
t.timestamps null: false
end
add_index :type_lookups, [:name], unique: true
@ -186,7 +186,7 @@ class CreateBase < ActiveRecord::Migration
t.boolean :persistent
t.string :name, limit: 100, null: false
t.string :action, limit: 40, null: false
t.timestamps
t.timestamps null: false
end
add_index :tokens, :user_id
add_index :tokens, [:name, :action], unique: true
@ -200,12 +200,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
t.timestamps 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
t.timestamps null: false
end
create_table :taskbars do |t|
@ -219,7 +219,7 @@ class CreateBase < ActiveRecord::Migration
t.integer :prio, null: false
t.boolean :notify, null: false, default: false
t.boolean :active, null: false, default: false
t.timestamps
t.timestamps null: false
end
add_index :taskbars, [:user_id]
add_index :taskbars, [:client_id]
@ -229,20 +229,20 @@ 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
t.timestamps 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
t.timestamps null: false
end
add_index :tag_objects, [:name], unique: true
create_table :tag_items do |t|
t.string :name, limit: 250, null: false
t.timestamps
t.timestamps null: false
end
add_index :tag_items, [:name], unique: true
@ -250,7 +250,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
t.timestamps null: false
end
add_index :recent_views, [:o_id]
add_index :recent_views, [:created_by_id]
@ -264,7 +264,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
t.timestamps null: false
end
add_index :activity_streams, [:o_id]
add_index :activity_streams, [:created_by_id]
@ -286,7 +286,7 @@ class CreateBase < ActiveRecord::Migration
t.string :value_from, limit: 250, null: true
t.string :value_to, limit: 250, null: true
t.integer :created_by_id, null: false
t.timestamps
t.timestamps null: false
end
add_index :histories, [:o_id]
add_index :histories, [:created_by_id]
@ -301,20 +301,20 @@ class CreateBase < ActiveRecord::Migration
create_table :history_types do |t|
t.string :name, limit: 250, null: false
t.timestamps
t.timestamps 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
t.timestamps 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
t.timestamps null: false
end
add_index :history_attributes, [:name], unique: true
@ -328,7 +328,7 @@ class CreateBase < ActiveRecord::Migration
t.string :state_initial, limit: 2000, null: true
t.boolean :frontend, null: false
t.string :preferences, limit: 2000, null: true
t.timestamps
t.timestamps null: false
end
add_index :settings, [:name], unique: true
add_index :settings, [:area]
@ -342,21 +342,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
t.timestamps 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
t.timestamps 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
t.timestamps null: false
end
add_index :store_files, [:sha], unique: true
add_index :store_files, [:provider]
@ -364,7 +364,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
t.timestamps null: false
end
add_index :store_provider_dbs, [:sha], unique: true
@ -381,7 +381,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
t.timestamps null: false
end
add_index :avatars, [:o_id, :object_lookup_id]
add_index :avatars, [:store_hash]
@ -395,7 +395,7 @@ class CreateBase < ActiveRecord::Migration
t.integer :user_id, null: false
t.boolean :seen, null: false, default: false
t.integer :created_by_id, null: false
t.timestamps
t.timestamps null: false
end
add_index :online_notifications, [:user_id]
add_index :online_notifications, [:seen]
@ -405,16 +405,16 @@ class CreateBase < ActiveRecord::Migration
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 :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
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
end
add_index :schedulers, [:name], unique: true
@ -429,7 +429,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
t.timestamps null: false
end
add_index :user_devices, [:user_id]
add_index :user_devices, [:os, :browser, :location]
@ -438,19 +438,19 @@ class CreateBase < ActiveRecord::Migration
add_index :user_devices, [:created_at]
create_table :object_manager_attributes do |t|
t.references :object_lookup, null: false
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 :editable, :boolean, null: false, default: true
t.column :active, :boolean, null: false, default: 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 :pending_migration, :boolean, null: false, default: true
t.column :position, :integer, null: false
t.column :created_by_id, :integer, null: false
t.column :updated_by_id, :integer, null: false
t.timestamps
t.column :pending_migration, :boolean, null: false, default: true
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
end
add_index :object_manager_attributes, [:object_lookup_id, :name], unique: true
add_index :object_manager_attributes, [:object_lookup_id]
@ -465,7 +465,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
t.timestamps null: false
end
add_index :delayed_jobs, [:priority, :run_at], name: 'delayed_jobs_priority'

View file

@ -3,9 +3,9 @@ class CreateTicket < ActiveRecord::Migration
create_table :ticket_state_types do |t|
t.column :name, :string, limit: 250, null: false
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
t.column :updated_by_id, :integer, null: false
t.column :created_by_id, :integer, null: false
t.timestamps null: false
end
add_index :ticket_state_types, [:name], unique: true
@ -13,21 +13,21 @@ class CreateTicket < ActiveRecord::Migration
t.references :state_type, null: false
t.column :name, :string, limit: 250, null: false
t.column :next_state_id, :integer, null: true
t.column :note, :string, limit: 250, 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
t.timestamps
t.column :note, :string, limit: 250, 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
t.timestamps null: false
end
add_index :ticket_states, [:name], unique: true
create_table :ticket_priorities 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.column :updated_by_id, :integer, null: false
t.column :created_by_id, :integer, null: false
t.timestamps
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
end
add_index :ticket_priorities, [:name], unique: true
create_table :tickets do |t|
@ -65,7 +65,7 @@ class CreateTicket < ActiveRecord::Migration
t.column :type, :string, limit: 100, null: true
t.column :updated_by_id, :integer, null: false
t.column :created_by_id, :integer, null: false
t.timestamps
t.timestamps null: false
end
add_index :tickets, [:state_id]
add_index :tickets, [:priority_id]
@ -96,11 +96,11 @@ class CreateTicket < ActiveRecord::Migration
add_index :tickets, [:type]
create_table :ticket_flags do |t|
t.references :tickets, null: false
t.references :tickets, null: false
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
t.column :created_by_id, :integer, null: false
t.timestamps null: false
end
add_index :ticket_flags, [:tickets_id, :created_by_id]
add_index :ticket_flags, [:tickets_id, :key]
@ -108,11 +108,11 @@ class CreateTicket < ActiveRecord::Migration
add_index :ticket_flags, [:created_by_id]
create_table :ticket_time_accounting do |t|
t.references :tickets, null: false
t.references :ticket_articles, null: true
t.references :tickets, null: false
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
t.column :created_by_id, :integer, null: false
t.timestamps null: false
end
add_index :ticket_time_accounting, [:tickets_id]
add_index :ticket_time_accounting, [:ticket_articles_id]
@ -121,27 +121,27 @@ class CreateTicket < ActiveRecord::Migration
create_table :ticket_article_types do |t|
t.column :name, :string, limit: 250, null: false
t.column :note, :string, limit: 250, null: true
t.column :communication, :boolean, null: false
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
t.column :communication, :boolean, null: false
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
end
add_index :ticket_article_types, [:name], unique: true
create_table :ticket_article_senders do |t|
t.column :name, :string, limit: 250, null: false
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
t.column :updated_by_id, :integer, null: false
t.column :created_by_id, :integer, null: false
t.timestamps null: false
end
add_index :ticket_article_senders, [:name], unique: true
create_table :ticket_articles do |t|
t.references :ticket, null: false
t.references :type, null: false
t.references :sender, null: false
t.references :ticket, null: false
t.references :type, null: false
t.references :sender, null: false
t.column :from, :string, limit: 3000, null: true
t.column :to, :string, limit: 3000, null: true
t.column :cc, :string, limit: 3000, null: true
@ -153,11 +153,11 @@ class CreateTicket < ActiveRecord::Migration
t.column :content_type, :string, limit: 20, null: false, default: 'text/plain'
t.column :references, :string, limit: 3200, null: true
t.column :body, :text, limit: 4.megabytes + 1
t.column :internal, :boolean, null: false, default: false
t.column :internal, :boolean, null: false, default: false
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
t.column :updated_by_id, :integer, null: false
t.column :created_by_id, :integer, null: false
t.timestamps null: false
end
add_index :ticket_articles, [:ticket_id]
add_index :ticket_articles, [:message_id_md5]
@ -169,11 +169,11 @@ class CreateTicket < ActiveRecord::Migration
add_index :ticket_articles, [:sender_id]
create_table :ticket_article_flags do |t|
t.references :ticket_articles, null: false
t.references :ticket_articles, null: false
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
t.column :created_by_id, :integer, null: false
t.timestamps 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]
@ -187,20 +187,20 @@ class CreateTicket < ActiveRecord::Migration
add_index :ticket_counters, [:generator], unique: true
create_table :overviews do |t|
t.references :user, null: true
t.references :role, null: false
t.references :user, null: true
t.references :role, null: false
t.column :name, :string, limit: 250, null: false
t.column :link, :string, limit: 250, null: false
t.column :prio, :integer, null: false
t.column :prio, :integer, null: false
t.column :condition, :string, limit: 2500, 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
t.column :organization_shared, :boolean, null: false, default: false
t.column :view, :string, limit: 1000, null: false
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
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
end
add_index :overviews, [:user_id]
add_index :overviews, [:name]
@ -225,34 +225,34 @@ class CreateTicket < ActiveRecord::Migration
t.column :subject, :string, limit: 250, null: false
t.column :body, :string, limit: 8000, null: false
t.column :content_type, :string, limit: 250, null: false
t.column :active, :boolean, null: false, default: true
t.column :active, :boolean, null: false, default: true
t.column :note, :string, limit: 250, null: true
t.timestamps
t.timestamps 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
t.column :active, :boolean, null: false, default: true
t.timestamps null: false
end
add_index :link_types, [:name], unique: true
create_table :link_objects 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
t.column :active, :boolean, null: false, default: true
t.timestamps null: false
end
add_index :link_objects, [:name], unique: true
create_table :links do |t|
t.references :link_type, null: false
t.column :link_object_source_id, :integer, null: false
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
t.references :link_type, null: false
t.column :link_object_source_id, :integer, null: false
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
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'
@ -261,24 +261,24 @@ class CreateTicket < ActiveRecord::Migration
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 :active, :boolean, null: false, default: true
t.column :active, :boolean, null: false, default: true
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
t.column :updated_by_id, :integer, null: false
t.column :created_by_id, :integer, null: false
t.timestamps null: false
end
add_index :postmaster_filters, [:channel]
create_table :text_modules do |t|
t.references :user, null: true
t.references :user, null: true
t.column :name, :string, limit: 250, null: false
t.column :keywords, :string, limit: 500, null: true
t.column :content, :string, limit: 5000, null: false
t.column :note, :string, limit: 250, 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
t.timestamps
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
end
add_index :text_modules, [:user_id]
add_index :text_modules, [:name]
@ -291,12 +291,12 @@ class CreateTicket < ActiveRecord::Migration
add_index :text_modules_groups, [:group_id]
create_table :templates do |t|
t.references :user, null: true
t.references :user, null: true
t.column :name, :string, limit: 250, null: false
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
t.column :updated_by_id, :integer, null: false
t.column :created_by_id, :integer, null: false
t.timestamps null: false
end
add_index :templates, [:user_id]
add_index :templates, [:name]
@ -309,14 +309,14 @@ class CreateTicket < ActiveRecord::Migration
add_index :templates_groups, [:group_id]
create_table :channels do |t|
t.references :group, null: true
t.references :group, null: true
t.column :adapter, :string, limit: 100, null: false
t.column :area, :string, limit: 100, null: false
t.column :options, :string, limit: 2000, 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
t.timestamps
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
end
add_index :channels, [:area]
add_index :channels, [:adapter]
@ -332,7 +332,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
t.timestamps null: false
end
add_index :slas, [:name], unique: true

View file

@ -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
t.timestamps 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
t.timestamps 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
t.timestamps 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
t.timestamps null: false
end
add_index :network_categories, [:network_id]
@ -54,7 +54,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
t.timestamps null: false
end
add_index :network_items, [:network_category_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
t.timestamps 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
t.timestamps 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
t.timestamps 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
t.timestamps 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'

View file

@ -14,7 +14,7 @@ class CreateJob < 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
t.timestamps null: false
end
add_index :jobs, [:name], unique: true
end

View file

@ -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
t.timestamps null: false
end
add_index :stats_stores, [:o_id]
add_index :stats_stores, [:key]

View file

@ -11,7 +11,7 @@ class CreateCalendar < ActiveRecord::Migration
t.timestamp :last_sync, null: true
t.integer :updated_by_id, null: false
t.integer :created_by_id, null: false
t.timestamps
t.timestamps null: false
end
add_index :calendars, [:name], unique: true

View file

@ -1,7 +1,7 @@
class UpdateTimestamps < ActiveRecord::Migration
def up
# get all models
Models.all.each {|model, value|
Models.all.each {|_model, value|
next if !value
next if !value[:attributes]
if value[:attributes].include?('changed_at')