Manage Database Changes with a Git Project
NineData can connect to Gitee and other Git projects that use HTTPS. After editing or comparing SQL files in SQL Console Git Workspace, generate change SQL and create a standalone SQL task, create a new Schema Design and Release process, or add the changes to an existing process.
Before you begin
- Create a Gitee project that is accessible through HTTPS, and prepare an account and password or access token with pull, commit, and push permissions.
- Add the data source where the changes will be executed to NineData.
- To submit a Schema Design and Release task, make sure an administrator has configured the corresponding process. For details, see Schema Design and Release.
Step 1: Configure the Git project
Sign in to NineData and go to System > Git Config.
Click Create and configure these parameters.
Parameter Description Protocol Select HTTPS. Project name Enter a recognizable project name. Project URL Enter the HTTPS clone URL of the Gitee project. Username Enter a Gitee username that can access the project. Password Enter the Gitee password or access token. Use a least-privilege token that can be rotated regularly. Email Enter the email address used for Git commits. Click Connection Test. After the test succeeds, save the configuration. NineData clones the project when the configuration is saved. The first clone can take some time for a large project.
Do not write a password or access token into an SQL file or commit it to the Git project. Store credentials only in the NineData Git configuration and rotate them under your organization's security policy.
Step 2: Edit and push Git changes
- Open DevOps, enter SQL Console for the target data source, and switch to Git Workspace.
- Select the configured project and target branch, then open or create SQL files and complete the changes.
- Use Diff to review file changes. Enter a commit message, then run Commit and Push. If a file is locked by another collaborator, wait until the lock is released before editing it.
Step 3: Generate change SQL and submit a task
In Git Workspace, select the changes to release and generate change SQL.
Select one of these submission types.
Submission type Usage Create SQL Task Create a standalone SQL execution task. Create Schema Design and Release Task Create a new Schema Design and Release process with the change SQL. Add to Existing Task Add the change SQL to an existing Schema Design and Release task. Verify the target data source, target database, and change SQL, then click Submit and Go. NineData creates or updates the task and opens its details page. Approval and execution then follow the normal SQL task or Schema Design and Release workflow.