
DataMapper doesn't create unique indices for subclassed models and potentially handles notnull constraints wrong
Reported by Fabian | December 10th, 2008 @ 08:10 AM
I attached a test case...
Comments and changes to this ticket
-
Fabian January 8th, 2009 @ 09:03 AM
- Tag set to associations, constraints, indices
can somebody look at this?
-
Dan Kubb (dkubb) February 21st, 2009 @ 02:19 AM
- Tag changed from associations, constraints, indices to associations, constraints, dm-core, indices
- State changed from unconfirmed to confirmed
I can confirm this is a problem, but I don't know the best way to handle it.
It's obvious that we can't just create a not-null fields in the database for the subclass. If we did that it would be impossible to save the superclass or siblings.
We may just have to ignore some constraints on subclass properties, like not-nullability and unique constraints for auto-upgrade and auto-migration. dm-validations should continue to behave as it currently does.
One thing to keep in mind is that uniqueness constraints could be for each backend. Even MySQL has different behavior for BDB vs InnoDB/MyISAM storage engines. BDB will treat NULL fields as unique (so you could only have a single row with a NULL value for that field). On the other hand InnoDB and MyISAM will ignore NULL values, and allow you to have multiple rows with a NULL value for a field.. the uniqueness constraint only applies to not-null values.
Anyone have anything more to add?
-
Dan Kubb (dkubb) June 16th, 2009 @ 10:38 PM
- Assigned user set to Dan Kubb (dkubb)
- Milestone set to 0.10.1
-
Dan Kubb (dkubb) June 16th, 2009 @ 10:40 PM
- State changed from confirmed to accepted
-
Dan Kubb (dkubb) October 4th, 2009 @ 09:33 PM
- Milestone changed from 0.10.1 to 0.10.2
[project:id#20609 not-tagged:"0.10.0" not-tagged:"0.10.1" milestone:id#51895 bulk edit command]
-
Dan Kubb (dkubb) February 1st, 2010 @ 04:33 PM
- Milestone changed from 0.10.2 to 1.0.0
-
-
-
Dan Kubb (dkubb) February 2nd, 2010 @ 02:47 AM
- State changed from accepted to confirmed
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 »