How to change column type in DB
Hi - I've tried using the graphical dialogue to change the type from INT to varchar, but it won't change.
So, I opened the consol and input the Storm recommended syntax: ALTER TABLE auburntree.contractors CHANGE skill_type skill_type VARCHAR(20);
And it still won't change.
Any ideas ??
Many Thanks
请先登录再写评论。
Edit- since my last post I went to PhpMyAdmin adn looked into the column and crazy - but it has changed to varchar() ... but inside Storm it still read Int. Only by closing Storm and reopening it does it synch properly ... so something appears to be amiss here.
Hi there,
Have you used "Synchronize" on that table after running the SQL command?
yes - I tried synch several times. The little wheel just spins and spins.
using 8.0.3 on Linux Mint
Hard to say -- it worked well for me when I was editing my DB (local MySQL, very small -- just 7 or 8 tables) -- in most cases I was just changing the field lengths.
I just used dedicated "Modify Column" dialog window instead of console ( https://confluence.jetbrains.com/display/PhpStorm/Databases+and+SQL+Editor+in+PhpStorm#DatabasesandSQLEditorinPhpStorm-AddingaColumntoanExistingTable ) and after clicking "OK" and auto sync (took like 2-3 seconds for a single table) it refreshed it just fine (using sample remote SQLServer DB).
How big is your DB? Do you have auto-sync enabled?
If DB is big (lots of tables/views/etc) then sync may take quite some time... (NOTE that you can sync single table instead of whole DB -- much faster, obviously).
I'm on Windows 7 x64, PhpStorm v8.0.3.
it's just a development DB .. it's tiny. 10 tables with 10 record in each.
As per my earlier post, the modify column dialogue did not appear to work *at all* ... I must have tried 5 times. In the end I went to PHP My admin ...and to my amazement it had worked, but the DB table still reported an int not a varchar() .... so looks like a synchronisation issue.
Don't know what to do ... Storm has a know problem with synch, I think.
Many thanks !
If you can reproduce the same behavior on another table .. then I may only suggest to submit a ticket to the Issue Tracker for corresponding dev to look into (basic sample DB/table structure with detailed steps would be required).