There are two potential bugs here.
One is fairly obvious: An AutoField obviously doesn't require an
initial value, but I don't believe Evolution makes a special case for
fields of that type - it assumes that any non-null field requires an
initial value. I can't think of a workaround - any user-supplied value
will inevitably be wrong. This should be relatively simple to fix, but
please log a ticket so that I don't forget to look at this.
The second potential issue is the change in semantics of
OneToOneField. I haven't looked into this in detail, but I know
Malcolm was talking about making changes to OneToOneFields. If this
means that the same model definition will cause different DB
implementations pre/post the QS-RF merge, we could be in for some fun,
because the current way Evolution is designed is based on the idea
that the relationship between model definition and database definition
is constant. If this is the case, the fix won't be simple, but log a
ticket so I don't forget to look at this.
Yours,
Russ Magee %-)
So am I... I discovered it incidentally while sniffing around MySQL contraints
(and updating Django in the meantime)...
> If this means that the same model definition will cause different DB
> implementations pre/post the QS-RF merge, we could be in for some fun,
Before:
CREATE TABLE `wss_user_profile` (
`user_id` integer NOT NULL PRIMARY KEY,
....
ALTER TABLE `wss_user_profile` ADD CONSTRAINT user_id_refs_id_4eac0a69
FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE INDEX `wss_user_profile_user_id` ON `wss_user_profile` (`user_id`);
After:
CREATE TABLE `wss_user_profile` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`user_id` integer NOT NULL UNIQUE,
ALTER TABLE `wss_user_profile` ADD CONSTRAINT user_id_refs_id_4eac0a69
FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE UNIQUE INDEX `wss_user_profile_user_id` ON `wss_user_profile`
(`user_id`);