Sha256: 440012c2b00397a87d74cfa22c22da1a63dbafc0d8d22462d096942d486371ce

Contents?: true

Size: 1.31 KB

Versions: 16

Compression:

Stored size: 1.31 KB

Contents

class CreateCustomFields < ActiveRecord::Migration
  def change
    create_table :core_custom_field_defs do |t|
      t.references    :owner, polymorphic: true
      t.string        :name
      t.string        :field_type
      t.integer       :row_order
      t.boolean       :required,        default: false
      t.string        :properties,      limit: 2048
      t.timestamps null: true
      t.integer       :account_id
    end

    add_index :core_custom_field_defs, :account_id
    add_index :core_custom_field_defs, [:owner_id, :owner_type]

    create_table :core_custom_field_def_translations, force: true do |t|
      t.integer     :core_custom_field_def_id
      t.string      :locale
      t.string      :label
      t.text        :description
      t.datetime    :created_at
      t.datetime    :updated_at
    end

    add_index :core_custom_field_def_translations, [:core_custom_field_def_id], name: 'core_custom_field_def_translations_index'

    create_table :core_custom_fields do |t|
      t.references    :owner, polymorphic: true
      t.integer       :custom_field_def_id
      t.string        :field_data,     limit: 4096
      t.timestamps null: true
      t.integer       :account_id
    end

    add_index :core_custom_fields, :account_id
    add_index :core_custom_fields, [:owner_id, :owner_type]
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dm_core-4.2.3.10 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.3.9 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.3.8 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.3.7 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.3.6 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.3.5 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.3.4 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.3.3 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.3.2 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.3.1 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.3 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.2.3 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.2.2 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.2.1 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.2 db/migrate/20140529164730_create_custom_fields.rb
dm_core-4.2.1.5 db/migrate/20140529164730_create_custom_fields.rb