#938 ✓resolved
Ashley Moran

DataMapper 0.10 does not make Serial properties SERIAL in PostgreSQL using dm-migrations

Reported by Ashley Moran | July 1st, 2009 @ 06:20 AM | in 0.10.0

The following migration makes 'id' INTEGER instead of SERIAL using the Postgres adapter

migration 1, :children do
  up do
    create_table :children do
      column :id,          Serial
      column :given_name,  String, :nullable => false
      column :family_name, String, :nullable => false
    end
  end

  down do
    drop_table :children
  end
end

To fix it you have to do this:

column :id, Serial, :serial => true

I believe the issue may be related to lines 67-68 of table_creator.rb:

primitive = type_class.respond_to?(:primitive) ? type_class.primitive : type_class
schema = @adapter.class.type_map[primitive].merge(schema)

In 0.9.11, the corresponding branch does this:

schema = @adapter.class.type_map[type_class].merge(schema)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Tags

Referenced by

Pages