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.0.pre19 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre18 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre16 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre15 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre14 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre13 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre12 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre11 test/interactive_primary_key.rdoctest
hobo_fields-1.3.0.pre10 test/interactive_primary_key.rdoctest