I'm running into this issue as well.  All tables are InnoDB

On Wednesday, March 23, 2011 1:21:18 PM UTC-6, Markei.nl, Maarten wrote:
>
> Are there more people with the same problem? 
>
> On 21 mrt, 16:48, "Markei.nl, Maarten" <[email protected]> wrote: 
> > Same problem on Linux 
> > 
> > PHP 5.3.3-1ubuntu9.3 
> > MySQL 5.1.49-1ubuntu8.1 
> > Ubuntu 10.10 Maverick x86 
> > 
> > On 20 mrt, 17:00, "Markei.nl, Maarten" <[email protected]> wrote: 
> > 
> > 
> > 
> > > PHP 5.3.5 MSVC9 x86 
> > > MySQL 5.5.8 x86 
> > > Windows 7 Pro. x64 
> > 
> > > On 20 mrt, 09:35, Benjamin Eberlei <[email protected]> wrote: 
> > 
> > > > What exact version of MySQL are you using? 
> > 
> > > > On Sat, 19 Mar 2011 05:33:56 -0700 (PDT), "Markei.nl, Maarten" 
> > 
> > > > <[email protected]> wrote: 
> > > > > Hi, 
> > 
> > > > > Each time I run orm:schema-tool:update Doctrine 2 creates all the 
> > > > > foreign keys, including foreign keys that are generated in a 
> previous 
> > > > > update. 
> > 
> > > > > Below my code and how the database looks after running orm:schema- 
> > > > > tool:update 2 times. 
> > 
> > > > > Is this a bug or (a feature or) do I make a mistake somewhere? 
> > 
> > > > > class Site 
> > > > > { 
> > 
> > > > > // ... 
> > 
> > > > > /** 
> > > > >  * Pages 
> > > > >  * @var \Doctrine\Common\Collections\Collection 
> > > > >  * @OneToMany(targetEntity="Page", mappedBy="site") 
> > > > >  */ 
> > > > > private $pages; 
> > 
> > > > > // ... 
> > 
> > > > > } 
> > 
> > > > > class Page 
> > > > > { 
> > 
> > > > > // ... 
> > 
> > > > > /** 
> > > > >  * 
> > > > >  * Site 
> > > > >  * @var Site 
> > > > >  * 
> > > > >  * @ManyToOne(targetEntity="Site", inversedBy="pages") 
> > > > >  * @JoinColumn(name="site_id", referencedColumnName="id") 
> > > > >  */ 
> > > > > private $site; 
> > 
> > > > > // ... 
> > 
> > > > > } 
> > 
> > > > > Generated SQL first time I run orm:schema-tool:update 
> > > > > CREATE TABLE nl_markei_ligilo__Site (id INT AUTO_INCREMENT NOT 
> NULL, 
> > > > > hostname VARCHAR(255) NOT NULL, technicalname VARCHAR(255) NOT 
> NULL, 
> > > > > start_url VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, 
> UNIQUE 
> > > > > INDEX nl_markei_ligilo__Site_hostname_uniq (hostname), UNIQUE 
> INDEX 
> > > > > nl_markei_ligilo__Site_technicalname_uniq (technicalname), PRIMARY 
> > > > > KEY(id)) ENGINE = InnoDB; 
> > 
> > > > > CREATE TABLE nl_markei_ligilo__Page (id INT AUTO_INCREMENT NOT 
> NULL, 
> > > > > site_id INT DEFAULT NULL, template_id INT DEFAULT NULL, name 
> > > > > VARCHAR(255) NOT NULL, technicalname VARCHAR(255) NOT NULL, url 
> > > > > VARCHAR(255) NOT NULL, position INT NOT NULL, title VARCHAR(255) 
> > > > > DEFAULT NULL, author VARCHAR(255) DEFAULT NULL, keywords 
> VARCHAR(255) 
> > > > > DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, last_change 
> > > > > VARCHAR(255) DEFAULT NULL, robots VARCHAR(255) DEFAULT NULL, 
> revisit 
> > > > > VARCHAR(255) DEFAULT NULL, content_language VARCHAR(255) DEFAULT 
> NULL, 
> > > > > body_only TINYINT(1) DEFAULT NULL, UNIQUE INDEX 
> > > > > nl_markei_ligilo__Page_technicalname_uniq (technicalname), INDEX 
> > > > > nl_markei_ligilo__Page_site_id_idx (site_id), INDEX 
> > > > > nl_markei_ligilo__Page_template_id_idx (template_id), PRIMARY 
> KEY(id)) 
> > > > > ENGINE = InnoDB; 
> > 
> > > > > ALTER TABLE nl_markei_ligilo__Page ADD FOREIGN KEY (site_id) 
> > > > > REFERENCES nl_markei_ligilo__Site(id); 
> > 
> > > > > Generated SQL second/third/... time I run orm:schema-tool:update 
> > > > > ALTER TABLE nl_markei_ligilo__Page ADD FOREIGN KEY (site_id) 
> > > > > REFERENCES nl_markei_ligilo__Site(id); 
> > 
> > > > > After running the orm:schema-tool:update 2 times the Page table in 
> the 
> > > > > database has the following constraints: 
> > > > > INDEX `nl_markei_ligilo__Page_site_id_idx` (`site_id`), 
> > > > > INDEX `nl_markei_ligilo__Page_template_id_idx` (`template_id`), 
> > > > > CONSTRAINT `nl_markei_ligilo__page_ibfk_4` FOREIGN KEY 
> (`template_id`) 
> > > > > REFERENCES `nl_markei_ligilo__template` (`id`), 
> > > > > CONSTRAINT `nl_markei_ligilo__page_ibfk_1` FOREIGN KEY (`site_id`) 
> > > > > REFERENCES `nl_markei_ligilo__site` (`id`), 
> > > > > CONSTRAINT `nl_markei_ligilo__page_ibfk_2` FOREIGN KEY 
> (`template_id`) 
> > > > > REFERENCES `nl_markei_ligilo__template` (`id`), 
> > > > > CONSTRAINT `nl_markei_ligilo__page_ibfk_3` FOREIGN KEY (`site_id`) 
> > > > > REFERENCES `nl_markei_ligilo__site` (`id`)

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to