Sha256: b8394d1b4f00315eb66dd82747c4c2a584060792f6cf7c290ddc2957f98097e0
Contents?: true
Size: 825 Bytes
Versions: 52
Compression:
Stored size: 825 Bytes
Contents
class CreateForemanTasksLinks < ActiveRecord::Migration[4.2] def change # rubocop:disable Rails/CreateTableWithTimestamps create_table :foreman_tasks_links do |t| task_id_options = { :index => true, :null => true } if on_postgresql? t.uuid :task_id, task_id_options else t.string :task_id, task_id_options end t.string :resource_type t.integer :resource_id end # rubocop:enable Rails/CreateTableWithTimestamps add_index :foreman_tasks_links, [:resource_type, :resource_id] add_index :foreman_tasks_links, [:task_id, :resource_type, :resource_id], :unique => true, :name => 'foreman_tasks_links_unique_index' end private def on_postgresql? ActiveRecord::Base.connection.adapter_name.casecmp('postgresql').zero? end end
Version data entries
52 entries across 52 versions & 1 rubygems