This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I've noticed that renaming columns in LIghtSpeed diagram results in deletion of the old column (along with all its data) and creation of a column with the new name. This is unacceptable when working on live database. Is there any way to rename columns in-place? In SQL there is a command for this: ALTER TABLE tablename RENAME COLUMN oldname to new_name; Would you recommend using this command directly on the database, rather than renaming through LightSpeed? Thanks! |
|
|
Hi, You might be able to do this by right clicking the column you want to rename and choose "Refactor" -> "Rename" you then have the opportunity to keep or change the DB field name. Cheers, Sean |
|
|
Thanks for your reply Sean! However, what I need is to actually rename the DB field, but without deleting the column with all its contents. What if I just use SQL for that, and not use LightSpeed? Will it corrupt my database or codebase in some way? |
|
|
Hi, I think that does rename the field in the DB as well rather than delete and re-create if you do it that way. You can also just manually rename in the DB if you wanted, and then just update your lsmodel from the DB and that would auto remove the old field from the model, and add the "new" (which is just the old renamed field) Cheers, Sean |
|