Sha256: 5dcaebc3cb410a84366002feacd0c88b608f22ef3ecbb7ad00d8e594e8359075

Contents?: true

Size: 273 Bytes

Versions: 12

Compression:

Stored size: 273 Bytes

Contents

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

      t.timestamps null: false
    end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
openstax_accounts-7.13.1 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.13.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.12.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.11.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.10.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.9.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.8.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.7.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.6.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.5.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.4.0 spec/dummy/db/migrate/1001_create_ownerships.rb
openstax_accounts-7.3.0 spec/dummy/db/migrate/1001_create_ownerships.rb