Sha256: 7eca3bddb0858eee8a00f8c3c8608720334941126f551672a29d36668c5997d0

Contents?: true

Size: 1.16 KB

Versions: 29

Compression:

Stored size: 1.16 KB

Contents

-*- indent-tabs-mode:nil; -*-

# HoboFields - Migration Generator

Our test requires to prepare the testapp:
{.hidden}

    doctest_require: 'prepare_testapp'

{.hidden}

And requires also that you enter the right choice when prompted. OK we're ready to get going.

## Alternate Primary Keys

### create
   doctest: create table with custom primary_key
   >>
    class Foo < ActiveRecord::Base
      fields do
      end
      set_primary_key "foo_id"
    end
   >> Rails::Generators.invoke 'hobo:migration', %w(-n -m)
   >> Foo.primary_key
   => 'foo_id'

### migrate from
   doctest: rename from custom primary_key
   >>
    class Foo < ActiveRecord::Base
      set_primary_key "id"
    end
   >> Rails::Generators.invoke 'hobo:migration', %w(-n -m)
   >> Foo.primary_key
   => 'id'

### migrate to

   doctest: rename to custom primary_key
   >>
    class Foo < ActiveRecord::Base
      set_primary_key "foo_id"
    end
   >> Rails::Generators.invoke 'hobo:migration', %w(-n -m)
   >> Foo.primary_key
   => 'foo_id'

### ensure it doesn't cause further migrations

   doctest: check no further migrations
   >> up, down = Generators::Hobo::Migration::Migrator.run
   >> up
   => ""

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
hobo_fields-1.3.3 test/interactive_primary_key.rdoctest
hobo_fields-1.3.2 test/interactive_primary_key.rdoctest
hobo_fields-1.3.1 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.RC4 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.RC3 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.RC2 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.RC1 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.RC test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre31 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre29 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre28 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre27 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre26 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre25 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre24 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre23 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre22 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre21 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre20 test/interactive_primary_key.rdoctest