
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
-
Dan Kubb (dkubb) July 16th, 2009 @ 01:08 AM
- Assigned user set to Dan Kubb (dkubb)
- State changed from new to unconfirmed
-
Dan Kubb (dkubb) July 22nd, 2009 @ 04:02 PM
- State changed from unconfirmed to accepted
-
Dan Kubb (dkubb) July 23rd, 2009 @ 11:55 AM
- Tag set to regression
-
Dan Kubb (dkubb) August 11th, 2009 @ 11:04 AM
This should also set BIGSERIAL if the :max option is greater than what a SERIAL can store.
EDIT: this will happen when dm-migrations uses dm-core code. For now will not make things worse by copying code in both places.
-
Dan Kubb (dkubb) August 14th, 2009 @ 03:04 AM
- State changed from accepted to resolved
(from [806b5c3bd67025269c9846d05116007f68127cd4]) [dm-migrations] Updated custom types to mix-in default options for migration
- Update column types to be all uppercase to match convention in dm-core
- Minor whitespace formatting change
[#938 state:resolved] http://github.com/datamapper/dm-more/commit/806b5c3bd67025269c9846d...
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.
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
-
938 DataMapper 0.10 does not make Serial properties SERIAL in PostgreSQL using dm-migrations [#938 state:resolved] http://github.com/datamapper/dm-mo...