Skip to main content

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

  1. Sign in to NineData and go to System > Git Config.

  2. Click Create and configure these parameters.

    ParameterDescription
    ProtocolSelect HTTPS.
    Project nameEnter a recognizable project name.
    Project URLEnter the HTTPS clone URL of the Gitee project.
    UsernameEnter a Gitee username that can access the project.
    PasswordEnter the Gitee password or access token. Use a least-privilege token that can be rotated regularly.
    EmailEnter the email address used for Git commits.
  3. 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.

caution

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

  1. Open DevOps, enter SQL Console for the target data source, and switch to Git Workspace.
  2. Select the configured project and target branch, then open or create SQL files and complete the changes.
  3. 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

  1. In Git Workspace, select the changes to release and generate change SQL.

  2. Select one of these submission types.

    Submission typeUsage
    Create SQL TaskCreate a standalone SQL execution task.
    Create Schema Design and Release TaskCreate a new Schema Design and Release process with the change SQL.
    Add to Existing TaskAdd the change SQL to an existing Schema Design and Release task.
  3. 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.