Sha256: e7d7a94220e69aa8b18d9e571ceee9e38aab0cc1b66cc4c8ede494373e98d892

Contents?: true

Size: 267 Bytes

Versions: 32

Compression:

Stored size: 267 Bytes

Contents

class CreateOwnerships < ActiveRecord::Migration
  def change
    create_table :ownerships do |t|
      t.references :owner, :polymorphic => true, null: false

      t.timestamps
    end

    add_index :ownerships, [:owner_id, :owner_type], :unique => true
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
openstax_accounts-7.2.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.1.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.0.1 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.0.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-6.4.2 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.4.1 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.4.0 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.3.2 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.3.1 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.3.0 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.2.0 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.1.7 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.1.6 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.1.5 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.1.4 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.1.3 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.1.2 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.1.1 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.1.0 spec/dummy/db/migrate/6_create_ownerships.rb
openstax_accounts-6.0.0 spec/dummy/db/migrate/6_create_ownerships.rb