I am still getting allot of the same problems but now in 2013. When working 
on localhost and pushing to pythonanywhere, then I get these MYSQL index 
errors with 150 message. 

The way to solve it has been to add fake_migrate_all=True to the DAL 
connection, but then I can not do any database changes. Any idea on how to 
solve this? I have had this trouble for a week now without being able to 
drop the index from my mysql (web2py auth_user) table. 

Cheers



On Thursday, September 17, 2009 5:04:39 AM UTC+8, David Zejda wrote:
>
> -----BEGIN PGP SIGNED MESSAGE----- 
> Hash: SHA1 
>
> Here: 
>
> http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html 
>
> they say: "To find out the symbol value when you want to drop a foreign 
> key, use the SHOW CREATE TABLE statement." 
>
> David 
>
> mdipierro napsal(a): 
> > One more reason to have mysql. 
> > 
> > How do we figure out the name of the foreign key from the name of the 
> > table/field? 
> > 
> > Massimo 
> > 
> > 
> > 
> > On Jul 22, 10:10 am, David Zejda <d...@atlas.cz> wrote: 
> > Yes, the problem is connected with dropping the index on interrelated 
> > field. If I try to manually 
> > 
> > DROP INDEX field2__idx ON testing4; 
> > 
> > or 
> > 
> > ALTER TABLE testing4 DROP field2; 
> > 
> > i get the error too. I examined the problem more and the result is: 
> > 
> > Field with a FOREIGN KEY can't stay without at least one index defined 
> > on it. But if you remove the relation first: 
> > 
> > ALTER TABLE testing4 DROP FOREIGN KEY testing4_ibfk_1; 
> > 
> > Either the index or the whole field may be removed without error.. 
> > 
> > David 
> > 
> > mdipierro napsal(a): 
> > 
> >>>> OK, I see we have a problem with removing fields that have an index 
> >>>> associated to them. 
> >>>> Can you try remove the index manually and then attempt the migration? 
> >>>> Massimo 
> >>>> On Jul 21, 5:45 pm, Fran <francisb...@googlemail.com> wrote: 
> >>>>> On Jul 21, 11:42 pm, Fran <francisb...@googlemail.com> wrote: 
> >>>>>> Confirmed. MySQL-5.1.36 with MySQL-python-1.2.2.win32 on 
> Python-2.5.4 
> >>>>>> on Windows XP 
> >>>>>> OperationalError: (1025, "Error on rename of '.\\db\\#sql-198_4' to 
> '.\ 
> >>>>>> \db\\testing4' (errno: 150)") 
> >>>>> sql.log doesn't show anything interesting: 
> >>>>> timestamp: 2009-07-21T23:39:53.171000 
> >>>>> CREATE TABLE ref2( 
> >>>>>         id INT AUTO_INCREMENT NOT NULL, 
> >>>>>         name VARCHAR(32), 
> >>>>>         PRIMARY KEY(id) 
> >>>>> ) ENGINE=InnoDB CHARACTER SET utf8; 
> >>>>> success! 
> >>>>> timestamp: 2009-07-21T23:39:53.750000 
> >>>>> CREATE TABLE testing4( 
> >>>>>         id INT AUTO_INCREMENT NOT NULL, 
> >>>>>         field VARCHAR(32), 
> >>>>>         field2 INT, INDEX field2__idx (field2), FOREIGN KEY (field2) 
> >>>>> REFERENCES ref2(id) ON DELETE CASCADE, 
> >>>>>         PRIMARY KEY(id) 
> >>>>> ) ENGINE=InnoDB CHARACTER SET utf8; 
> >>>>> success! 
> >>>>> timestamp: 2009-07-21T23:40:27.906000 
> >>>>> ALTER TABLE testing4 DROP COLUMN field2; 
> >>>>> F 
> > 
> -----BEGIN PGP SIGNATURE----- 
> Version: GnuPG v1.4.9 (GNU/Linux) 
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org 
>
> iEYEARECAAYFAkqxUucACgkQ3oCkkciamVHUWQCggWwyEIJVBCpfIN5lIOIslQZs 
> cx8An1K/h6PKBtkRbXusmFXQJGlYE23w 
> =ukBM 
> -----END PGP SIGNATURE----- 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to