rochacbruno-archive / Movuca

Movuca - web2py powered social CMS (this project is not updated/maintained anymore, if you want to adopt it, let me know, then I can transfer ownership)
Other
105 stars 27 forks source link

Strange behaviour when the database connector is changed #31

Open josedesoto opened 11 years ago

josedesoto commented 11 years ago

Hi,

If I change only the file movuca/modules/config.py to connect to MySql and after I open the install URL. It looks works fine. But I can see tables in Mysql and in SQlite. For example the auth tables and article_category table are in SQLite.

If I change the file config.py and setup.py to connects to MySql, and after I open the install URL. I get the error. It looks Movuca try to create the auth tables, article_category, etc in Mysql. I have seen in this case, Movuca creates as well the tables in SQLite.

More info in this link: http://www.web2pyslices.com/slice/show/1581/help-with-mysql-and-movuca

rochacbruno commented 11 years ago

did you see the config_movuca SQLITE database? the connection string is there.

On Mon, Jan 14, 2013 at 10:44 AM, Jose de Soto notifications@github.comwrote:

Hi,

If I change only the file movuca/modules/config.py to connect to MySql and after I open the install URL. It looks works fine. But I can see tables in Mysql and in SQlite. For example the auth tables and article_category table are in SQLite.

If I change the file config.py and setup.py to connects to MySql, and after I open the install URL. I get the error. It looks Movuca try to create the auth tables, article_category, etc in Mysql. I have seen in this case, Movuca creates as well the tables in SQLite.

More info in this link: http://www.web2pyslices.com/slice/show/1581/help-with-mysql-and-movuca

— Reply to this email directly or view it on GitHubhttps://github.com/rochacbruno/Movuca/issues/31.

josedesoto commented 11 years ago

If I make the default installation everything works fine. After that, if I change in config_movuca SQLITE database the string. Movuca add into the database another line:

id uri.... 1 mysql://root:... True True 10 google:datastore 2013-01-14 21:36:26 2 sqlite://movu... True True 10 google:datastore 2013-01-14 21:40:09

In the case before, nothing happens in Mysql. No tables are created.

If I change the connector database directly in file modules/datamodel/setup.py and I execute: http://localhost:8000/movuca/setup/install Movuca creates the config_movuca SQLITE database, and it has the new connector in field uri. After that Movuca creates in Mysql the next tables:

| article_category | | auth_cas | | auth_event | | auth_group | | auth_membership | | auth_permission | | auth_user | | content_type |

After that, Movuca redirects to the index page and I get the next error:

IntegrityError: (1452, u'Cannot add or update a child row: a foreign key constraint fails (movuca7.article_category, CONSTRAINT article_category_ibfk_1 FOREIGN KEY (parent_id) REFERENCES article_category (id) ON DELETE CASCADE)')

Could be the Mysql version? I am using Msql Server 5.1.66 with ubuntu 11.10.