Skip to main content

Release Database Changes from a Git Project

NineData lets you manage Git project files in SQL Console, compare file versions, generate change SQL, and submit the changes as an SQL Task, a Schema Design and Release task, or an existing Schema Design and Release task.

Before you begin​

  • Create a Git project that is accessible through HTTPS, and prepare a username and password or access token with access to the project.
  • Create the data source where NineData will execute the changes.
  • This feature currently targets relational databases. NoSQL, Elasticsearch, vector databases, and Milvus are outside the scope of this phase.

Step 1: Configure the Git project​

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

  2. Click Add Git Config and configure the following fields.

    ParameterDescription
    Protocol TypeSelect Https.
    NameEnter the project name.
    UrlEnter the HTTPS clone URL of the Git project.
    UserEnter a username that can access the project.
    PasswordEnter the password or access token.
    EmailEnter the email address used for Git commits.
  3. Complete the connection test in the form. After it succeeds, click Save. When the configuration is saved, NineData clones the Git project. The initial sync time depends on the project size.

caution

Do not write a password or access token into an SQL file or commit it to the Git project. Use a least-privilege token that can be rotated regularly.

Step 2: Manage files in Git Workspace​

  1. Open SQL Console and switch to Workspace.

  2. Select a Git project and target branch. If needed, click Pull to synchronize the latest remote content.

  3. Open or edit the target file in the file tree. Git Workspace provides Commit, Push, and Pull. After completing local changes, run Commit first and then Push.

    • When you select a branch, NineData checks out a locally cloned branch. A remote branch is pulled before it is checked out.
    • Edits to multiple files update the local cache and can be consolidated into one commit. The page updates the server cache after a file loses focus or after a period without input.
    • Git conflicts and Push or Pull errors are not resolved automatically in the page. Handle them according to the error returned by the current console.

Step 3: Generate change SQL​

  1. In Git Workspace, select the file versions to release and compare the versions.

  2. Review the generated change SQL. Table files generate an incremental change script; non-table files generate a full change script.

Step 4: Submit the change task​

  1. Select one submission type.

    Submission typeDescription
    Create an SQL taskCarry the change SQL and current data-source information to create an SQL Task.
    Create a schema design and release taskCarry the change SQL and current data-source information to create a Schema Design and Release task.
    Join an existing taskAdd the change SQL to an existing Schema Design and Release task.
  2. When adding to an existing task, confirm that the data source, database, and schema match the current environment and that the current user is a relevant person for the task. The target task must still be at its first node and must not be finished, terminated, or successful.

  3. Verify the change SQL and target information, then click Submit and go. A new task takes you to the corresponding creation page. Adding to an existing task takes you to that Schema Design and Release task's details page.