
dm-migrations creates a different Serial column than automigrate does
Reported by Greg Campbell | January 27th, 2009 @ 04:36 PM
dm-migrations uses the MySQL SERIAL column type, which is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT; automigrate creates an INT NOT NULL AUTO_INCREMENT. We should pick one and standardize on it. One issue to note here is that MySQL requires foreign key constraints to match column types, so foreign key columns that refer to serial columns would also have to be BIGINT UNSIGNED if we go with SERIAL for primary keys. This might necessitate a new ForeignKey type, or some other sort of inspection to determine the type of the referenced column in automigrations.
Comments and changes to this ticket
-
Paul Sadauskas (Rando) January 27th, 2009 @ 04:41 PM
using the SERIAL type when Serial is specified in properties or migrations is the right thing to do, I think.
an FKey dm-type seems reasonable, because it could then also take some additional params:
class Article property :id, Serial property :title, String property :author_id, FKey, :foreign_model => Person #etc... end
-
Dan Kubb (dkubb) September 10th, 2009 @ 03:44 PM
- State changed from unconfirmed to confirmed
- Assigned user cleared.
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 »