Wednesday, December 23, 2009

Re: Table Names and Foreign Keys

What rev are you running? I just tried this on Ubuntu 9.04 with Django
1.1.1 and got the following SQL generated. It looks right to me.

./manage.py sql test
BEGIN;
CREATE TABLE `Register` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`name` varchar(48) NOT NULL UNIQUE,
`title` varchar(48) NOT NULL,
`firstname` varchar(48) NOT NULL
)
;
CREATE TABLE `Charity` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`name` varchar(96) NOT NULL,
`register_id` integer NOT NULL
)
;
ALTER TABLE `Charity` ADD CONSTRAINT `register_id_refs_id_7239a021`
FOREIGN KEY (`register_id`) REFERENCES `Register` (`id`);
COMMIT;

--

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate