#9912 closed defect (fixed)
SimpleMultiProjectPlugin and MySQL not Working
Reported by: | Owned by: | falkb | |
---|---|---|---|
Priority: | high | Component: | SimpleMultiProjectPlugin |
Severity: | normal | Keywords: | MySQL, SimpleMultiProject |
Cc: | Trac Release: | 0.12 |
Description (last modified by )
When trying:
trac-admin /path/to/env upgrade
the same "Error" occurs like in ticket http://trac-hacks.org/ticket/9729
SimpleMultiProject database schema version: 1 initialized. SimpleMultiProject database schema is out of date: False Database is up to date, no upgrade necessary.
Trying to add the required tables with the attached file (http://trac-hacks.org/attachment/ticket/9729/load_db.sql) fails cause MySQL uses other syntax.
When adding tables manually using:
CREATE TABLE `smp_project` ( `id_project` INT(64) NOT NULL, `name` VARCHAR(512) NOT NULL, `description` VARCHAR(2048) NOT NULL DEFAULT '', PRIMARY KEY (`id_project`) ) COLLATE='utf8_bin' ENGINE=MyISAM; CREATE TABLE `smp_milestone_project` ( `id` INT(64) NOT NULL, `milestone` VARCHAR(512) NOT NULL, `id_project` INT(64) NOT NULL, PRIMARY KEY (`id`) ) COLLATE='utf8_bin' ENGINE=MyISAM;
the option "projects" is visible in Admin section of trac, but when tryin to add the second project a error occurs, so using the following code via phpMyAdmin
ALTER TABLE `smp_project` CHANGE COLUMN `id_project` `id_project` INT(64) NOT NULL AUTO_INCREMENT FIRST;
now adding projects works fine BUT -> after logout the "admin" button is still visible to anonymous and shows the project settings.
also there is no option to add/choose project when clicking on admin->milestones->edit milestone
so after all there are some things not correct when using MySQL as Database...
btw: using Trac 0.12.3 under http://trac.rc-hosting.net
Attachments (0)
Change History (11)
comment:1 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 12 years ago by
comment:4 Changed 12 years ago by
Currently, only sqlite is supported/tested. I haven't found a sufficiently good page explaining what exactly must be done for a port to MySQL. Anyway, most stuff is in model.py, patch for it is welcome.
comment:5 Changed 12 years ago by
In MySQL the length of VARCHAR is mandatory!
In Rev. 11731 the summary-field is missing. (The following patch fixes the issue for mysql).
-
simplemultiproject/environmentSetup.py
a b 16 16 db_version = 4 17 17 18 18 tables = [ 19 Table('smp_project', key = 'id ') [19 Table('smp_project', key = 'id_project') [ 20 20 Column('id_project', type = 'integer', auto_increment = True), 21 Column('name',type = 'varchar'), 22 Column('description',type='varchar') 21 Column('name', type = 'varchar(255)'), 22 Column('summary', type='varchar(255)'), 23 Column('description', type='varchar(255)') 23 24 ], 24 25 Table('smp_milestone_project',key = 'id') [ 25 26 Column('id', type = 'integer', auto_increment = True), 26 Column('milestone', type = 'varchar'),27 Column('milestone', type = 'varchar(255)'), 27 28 Column('id_project',type = 'integer') 28 29 ], 29 30 ] … … 32 33 # Added with version 2 33 34 Table('smp_version_project',key = 'id') [ 34 35 Column('id', type = 'integer', auto_increment = True), 35 Column('version',type = 'varchar '),36 Column('version',type = 'varchar(255)'), 36 37 Column('id_project',type = 'integer') 37 38 38 39 ],
comment:7 Changed 12 years ago by
Thanks for the patch, though I wonder if this is still compatible with the other supported database types, like SqLite (?). And as someone already asked, is this all to get the plugin running with MySQL? I can't test it but don't want to apply blindly.
comment:8 Changed 12 years ago by
Yes it works for me: @ mysql-5.1.62 . Trac 0.12
I haven't tested on other dbms.
Micha
comment:9 Changed 12 years ago by
Owner: | changed from Christopher Paredes to falkb |
---|---|
Status: | new → assigned |
OK, then I'm going to test the patch with my SQLite system by trial'n'error.
comment:9 Changed 12 years ago by
comment:10 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
works as expected with mysql!
trac > trac-admin . upgrade SimpleMultiProject database schema version: 4 initialized. SimpleMultiProject database schema version: 0 installed. SimpleMultiProject database schema is out of date: True SimpleMultiProject database schema version: 4 initialized. SimpleMultiProject database schema version: 0 installed. SimpleMultiProject database schema is out of date: True Upgrading SimpleMultiProject database schema Upgrading SimpleMultiProject database schema Upgrade done.
Micha
thanks for the report problems found. You ask excuse for not correct yet, I hope to work soon on these improvements.
regards