timetracking
timetracking copied to clipboard
Error while instaling on postgresql
Hello!
I'm using Mantis with postgresql. timetracking plugin tries to create table but special word user
isn't properly escaped ( https://www.postgresql.org/docs/current/static/sql-keywords-appendix.html ):
ERROR: syntax error at or near "user" at character 134
2018-02-27 19:53:30 CET HOST:127.0.0.1 xxx VTID:3/55833 STATEMENT: CREATE TABLE mantis_plugin_TimeTracking_data_table (
id SERIAL,
bug_id INTEGER DEFAULT NULL,
user INTEGER DEFAULT NULL,
expenditure_date TIMESTAMP DEFAULT NULL,
hours FLOAT8 DEFAULT NULL,
timestamp TIMESTAMP DEFAULT NULL,
category VARCHAR(255) DEFAULT NULL,
info VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (id)
)
Are you using "master" branch? if so, then i guess it cant be installed then...
The "next" branch (which is an experimental rewrite of the functionality) uses "user_id" for that reason. However, by the nature of schema updates applying incrementally, the starting step will fail too. You could modify manually the schema definitions to get to the final state where the old "user" field is dropped, and the new field "user_id" is kept.
Yes, I'm trying master branch.
I tried branch next
, with some manual sqling I installed plugin. Now I'm trying to discover how plugin works. I enabled time tracking in Mantis core earlier, maybe I shouldn't do it?
by the nature of schema updates applying incrementally, the starting step will fail too.
I have not actually tested this, but maybe it could work by altering schema step 0 to create the table with the correct column name (user_id
), and somehow make the new column creation and data migration conditional to the existence of the user
column. Maybe you can try to rename the column instead of manually creating/copying data/dropping it.
If it's too complex or not feasible, then make a breaking change so that the plugin installs cleanly, and provide manual upgrade instructions in the form of SQL statements for users upgrading from earlier versions.
I have not actually tested this, but maybe it could work by altering schema step 0 to create the table with the correct column name (user_id), and somehow make the new column creation and data migration conditional to the existence of the user column.
yes, that's what i had in mind, something in that line.
Maybe you can try to rename the column instead of manually creating/copying data/dropping it.
I think with the previous suggestion, it's better to keep the "create column" for the proper naming
I'm still having issues with installing the next branch on a Postgres installation ( Mantis BT 2.22.0 / 209 )
@semanticfire can you test this pull request: #46 to address this issue
The installation works, let me check later this week if everything works as expected
So the install works but I now run into errors when opening a issue, claiming the table for the plugin is missing ( which actually is true )
So the install works but I now run into errors when opening a issue, claiming the table for the plugin is missing ( which actually is true )
Have you:
- Delete
plugin_TimeTracking_schema
config - Delete the table (if it exists)
- install plugin
That does the trick! ( maybe unrelated, should it migrate existing time spend information? )
( maybe unrelated, should it migrate existing time spend information? )
you can migrate the data from the builtin timetracking to be used in this plugin (and can skip the "delete old data" step), but this new branch is not stable and may have unexpected changes.
Where can I find this migration?
That branch has another directory with the migration tool. Its a separate plugin
El dom., 9 feb. 2020 20:37, Bart van Leeuwen [email protected] escribió:
Where can I find this migration?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mantisbt-plugins/timetracking/issues/36?email_source=notifications&email_token=ADLYGI3URVBGCS5GWYRE7MTRCBLQTA5CNFSM4ESV7LQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELGV3GY#issuecomment-583884187, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADLYGIYNXAFL5KZPIEEUO3DRCBLQTANCNFSM4ESV7LQQ .
MantisBT 2.25.2 PostgreSQL 9.6.9
Install plugin error: APPLICATION ERROR #2503 Plugin schema update crashed at block # 1