As I understand it, database stuff is a recent addition to phpstorm. I my self have just started using it. I really love the idea of being able to do all of my work from one place and not have to keep loading up phpmyadmin and whatnot. Unfortunately the DB tools just arent totally there yet and thus are more useless than useful to me. Here is a list of my gripes / needs and if I'm off base on something and you can do something I think is missing let me know.
- Insert colum at position (add to context right click on table column when columns are not sorted alpha). What this feature should do is auto select the field name for the field above the clicked on field from a drop down of all columns in the add column dialog. This dropdown should be attached to the 'AFTER' label that would need to be added. This way even if you didnt choose an insert location when telling it to add a column name you can still select an after column in the box. The columns should always be ordered acording to the schema in this selection box and not alphabetically.
- Modify the add column / modify column dialogs to include an AUTO_INCREMENT check box (and allow the starting value to be entered).
- All in all the whole schema editing stuff could be improved. It seems to be lacking a LOT of functionality phpMyAdmin has in regard to modifying the schema.
- Need right click on table name context menu to "insert" which would give a dialog box similar to phpMyAdmin add row (paying specifica attention to the functions drop down for each row). Right now, it appears the only way to manually enter a row is to F4 show the table data then click the + sign which adds a blank row which can be edited inline.
- When editing the table data there needs to be a way to specify a mysql functions - Its nice to have a drop down to select the function instead of just having autocomplete, but even thats not available. If I edit a field and put PASSWORD('somedata') and hit enter, it literally saves that string to the database. It does not execute the desired query of field_name=PASSWORD('somedata'). What the hell?
Lastly, the difference tool for sql is totally fucked.
When i create a new feature or hotfix branch on my project I also duplicate the database which is named <ORIG_DB_NAME>_<BRANCH_NAME> (so mysite_store -> mysite_store_feature-saved-carts).
I do my work on the new branch and change the sql schema along the way. New tables, dropping columns and dropping tables work ok.The problem is, when I rename a column in the schema, the diff function generated when its time to merge will completely destroy all of the data in the column that was renamed and it will not honor the position of any newly added column.
How is this you ask?
Becuase the DIFF script generated to "merge" the table schemas does not use the alter table CHANGE command, it completely drops the column and then re-adds it. And not only does it do that, but it doesnt even put the column back where it was when I issued the modify command. If I run this generated script to update my production site, and I changed the username column to user_id or something, then every single account on the published site would loose their "log in name" and the column would be at the end of the table after "last_login" which is not inline with how I structure my tables. The diff script generated also does not insert "AFTER" clauses when appropriate, even if I specifically added an "AFTER" to the statement where I added the new column.
Because of all this I still have to use phpMyAdmin to manage my schemas, and insert manual data. I still use the IDE for reference and testing queries but thats really kinda defeating the purpose of having all this at my finger tips.
I even have to use and maintain my own schema diffing scripts which is less then ideal since this functionality is technically built into the ide, albiet just not correctly in my opinion.
Anyone else agree / disagree?