Performing Refactoring of Database Objects
Last modified: October 18, 2023
Renaming database objects using refactoring implies making changes in all dependencies. This way all relations, foreign keys, and references will be kept. This topic gives description of performing renaming procedure of a database object using refactoring.
Renaming Objects from Database Explorer
Basic refactoring process
1. Select the object you want to rename in the Database Explorer tree and right-click it.
2. On the shortcut menu, point to Refactoring, and then click Rename.
3. In the Rename dialog box, enter the new name of the object and click OK.
4. In the Preview Changes window, view the changes that will be applied to your database. Clear the check boxes near the ones that you do not need.
5. Click Apply.
-or-
1. Double-click an object you want to rename.
2. Change the name and press ENTER.
3. In the message box, click Refactor.
4. In the appeared Preview Changes window, view the changes that will be applied to your database. Clear the check boxes near the ones that you do not need.
- Click Apply.
Using refactoring script
You can view changes that will be made to the database before applying them. For this, you can:
- Check the Generate script without updating database option.
- Click Apply.
- The generated script will be opened in the SQL Editor.
- View the script and press F5 to execute it and apply changes to the database.
Renaming Database Objects from Object Editors
To rename an object with refactoring from object editor, you should:
- Open the object editor.
- Rename the object.
Note
You can also rename columns using refactoring in the table editor.
- Click the Update Database or Script Changes button.
- In the appeared message, click Yes.
- View changes in the Preview Changes window, adjust them, if needed.
- Click Apply or Generate (depends on what you are doing - updating a database right away or viewing script changes).
Multiple refactoring in table editor
You can rename several columns at once using refactoring. To do this:
- Open the table you want to edit in the table editor.
- Rename the columns you need to rename.
- Click the Update Database or Script Changes button.
- View changes in the Preview Changes window. Changes in the tree are grouped by columns.
- Click Apply or Generate (depends on what you are doing - updating a database right away or viewing script changes).
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for MySQL.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.