kingheat / anarchintosh-projects

Automatically exported from code.google.com/p/anarchintosh-projects
0 stars 0 forks source link

Mysql database creation on icefilms #212

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. enter credentials for mysql connection in the icefilms plugin settings
2. start plugin doesn't work anymore :-)

The plugin will start and tries to exectute mysql query: "CREATE TABLE IF NOT 
EXISTS cache_data (name TEXT, value TEXT), PRIMARY KEY(name))"

But in MySql it's not possible to create a primary key on a TEXT field. Its 
possible when 'name' is a VARCHAR but that limits the string length. 

Replacing line 326 of db_utils.py will fix te error. I just removed ", PRIMARY 
KEY(name))" so the query will be "CREATE TABLE IF NOT EXISTS cache_data (name 
TEXT, value TEXT)"

But at every update of the plugin I do have to make this change by hand, please 
correct the sourcecode. The MySql intergration is realy great! 

Original issue reported on code.google.com by RoderikM...@gmail.com on 16 Jun 2015 at 6:27

GoogleCodeExporter commented 8 years ago
see issue 213 for correct solution

CREATE TABLE IF NOT EXISTS cache_data (name TEXT, value TEXT, PRIMARY 
KEY(name(250)))'

you can create a primary key on text, name(250) trucates it

Original comment by anthony....@gmail.com on 19 Jul 2015 at 1:20