This topic explains how to build and deploy a project.
After you have edited your database project, you should build it to create a script that will deploy all the project changes to the database on the server. A project can be built to a single ready-to-deploy script or a set of scripts with a batch to run it in the MySQL Command-Line Tool.
Note
Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. These elements are determined by your Visual Studio edition and settings. For more information, see Visual Studio Settings.
To build a project:
Project building is enhanced with the following features:
Before building the project, you can set project options to customize build results.
The Build Order tab lets you manage the order of files in the build script and deploy execution. You can manage dependencies between objects in different files using build order. For example, table film2 in film_text.Table.sql references table film1 in film_Table.sql, so you should move film_text.Table.sql to locate under film_Table.sql on the Build Order tab.
Note
Actual document look may slightly vary from the above image, depending on the product you use.
Note
Actual document look may slightly vary from the above image, depending on the product you use.
To deploy a project, choose project configuration, and click Deploy the Project on the project shortcut menu.
Note
Project files can be deployed only if a connection was assigned to the project.
To deploy an entire project, click Deploy the Project on the Build menu.
Use the Always re-create a database option to guarantee database integrity.
When you want to deploy only the changes from your project to the server, you should compare your project with the database on the server and create a special schema synchronization script. The script will deploy only required changes to the server.
Right-click in the Solution Explorer window and select the Synchronize Project with Server option. The document with comparison results opens.
Note
Actual document look may slightly vary from the above image, depending on the product you use.
To synchronize changes from the database on the server with your project, do the following:
Select the database on the server as Source and your project as Target.
Note
Actual document look may slightly vary from the above image, depending on the product you use.
While comparing, the project can be either Source or Target. Note, the project is automatically built during comparison, so if any errors occur during this process, the comparison fails.