Skip to main content

Schema Design and Release

The Schema Design and Release feature enables multi-environment development process management, facilitating smooth progress in development across different environments. It ensures that all necessary validations, changes, and approvals are completed before the code is deployed to the production environment.

Feature Introduction

In the development process of an enterprise, there are usually multiple stages progressively advancing. Typically, there are at least two key stages: development testing environment and production environment. Due to considerations of the security of the production environment, only SQL scripts that have been executed and successfully validated in the development testing environment are allowed to be released to the production environment. On the other hand, the development testing phase may undergo multiple rounds of modifications. To ensure the integrity of changes, it is necessary to ensure that all changes are applied to the production environment in sequence, otherwise, it may lead to missed changes and issues such as application deployment failure.

The Schema Design and Release feature consolidates all change tasks made by developers to the baseline data source in the development testing environment into a single SQL script, recording their execution sequence and dependencies. When submitting changes to non-baseline data sources, administrators can require only SQL script execution, thereby preventing change errors due to mistakes or omissions.

Through the Schema Design and Release feature, project administrators can have a clear understanding of the execution status and progress of the entire process. All developers can also view the execution status of each task at any time, facilitating the discovery and resolution of issues and ensuring smooth progress of the process.

Notes

Please refer to the precautions in the content from '../ref/_ref-precautions.md'.

Step One: Configure Schema Design and Release Process

NineData comes with default process configurations, consisting of two nodes: and . These nodes allow development team members to skip the current node, edit SQL executed in the previous node, and revert to the previous node.

You can edit the default Schema Design and Release process according to actual business needs or create a new one based on this process. This article will use adding a new Schema Design and Release process as an example to explain the configuration method.

  1. Log in to the NineData console.

  2. In the left navigation bar, click > .

  3. Click on the tab, then click on in the upper right corner to open the window. After completing the configuration according to the table below, click on .

    You can also click on under the column on the right side of the existing process.

    Parameter
    Description
    Select an existing Schema Design and Release process to create a new one based on that process. If you use the method, this field will be automatically filled.
    Enter the name of the Schema Design and Release process, up to 32 characters.
    Enter a description of this Schema Design and Release process.
  4. Click on the newly created , or click on under column of the process name to open the page.

  5. Since the current process is copied from another process, and the data source corresponding to the first node must be globally unique, the first step must be to modify the data source corresponding to the node with set to 1, otherwise, other content cannot be edited. Click on on the right side of this node, modify the parameter, and then click .

  6. Click on on the right side of the page to add nodes to the process. For example, in the default and , add a Test Environment node. Configure it according to the table below, then click .

    Parameter
    Description
    Enter the name of the node to be added. For example: Test Environment.
    Select the data source corresponding to this node, supporting addition based on or . Note that the data source or environment cannot be added repeatedly with the same data source or environment as the first node.
    • : All data sources belonging to this environment can be changed in this node.
    • : You can select the target database (Schema) corresponding to the target data source, accurately controlling the data sources that this node can change. You can click on to add multiple data sources.
    • : Whether to allow rollback from the current node to the previous node.
    • : Whether to allow users to edit SQL scripts when making changes to non-baseline databases in the standard process.
    • : Whether to allow skipping the current node and directly advancing to the next node without executing any changes.
  7. After creating the nodes, you can sort, edit, and delete nodes on the page.

    • Sorting: Hover over the row of the target node, then click on the up icon on the left side of to move the node up.
    • Editing: Click under column on the right side of the target node to edit its details.
    • Deleting: Click under column on the right side of the target node to delete it.

    Switch

    On the page, you can use shortcut switches to quickly edit the configurations of each node (, , ) without entering the editing page of each node.

  8. Return to the page, turn on the switch under the column of the target process to activate it.

Step Two: Create Schema Design and Release

  1. Log in to the NineData console.

  2. In the left navigation bar, click on > .

  3. Click on on the right side of the page.

  4. On the page, configure according to the table below, then click .

    Parameter
    Description
    Enter the name of the flow. To reduce communication costs, please use meaningful names as much as possible. Up to 64 characters are supported.
    The baseline data source for the Schema Design and Release process. All changes will revolve around this data source, and all SQL executed in the baseline data source will be automatically organized into SQL scripts according to the execution sequence by the system. Based on the process configuration, administrators can require that changes to non-baseline databases can only be based on this SQL script, and no other changes are allowed to be executed.
    Select a database as the baseline database for the Schema Design and Release process.
    After the change approval in the Schema Design and Release process, the executor of the SQL statement.
    Note: The options in the list depend on the following two situations:
    • If the current data source is configured with development specifications: The options in the list are based on the rule configured in the current specification. This rule is located on the tab. For how to configure development specifications, please refer to Edit Specifications.
    • If the current data source is not configured with development specifications: The options in the list are users who have the permission for the current data source. For more information about permissions, please refer to Configure User Permissions.
    (optional)Select collaborators for the current process, who can participate in the current Schema Design and Release process to drive development work together.
    (optional)Explanation of unfinished items in the current Schema Design and Release process.
    Enter the change SQL to be executed or upload a file containing the change SQL.
    • : Enter the SQL statement to be executed directly in the text box.
    • : Click on , select and upload the file containing the SQL statements to be executed.
      Note: After uploading, hover over the file name to the right of the file name and you can choose review (preview file) or delete (delete file).
  5. The page will automatically redirect to the task details page of the current Schema Design and Release process. NineData automatically creates a SQL change task for the baseline database. You need to progress this change task in (). Only after the task status changes to , you can continue with the following steps.

Step Three: Using Schema Design and Release Process

The Schema Design and Release process can have multiple nodes, which need to be progressed step by step according to the administrator's configuration. Taking the default scenario as an example, there are two nodes: and . Each node has a task list, and all of this process can submit SQL tasks here to make changes to the database.

Step Three (1): Submitting Tasks

  1. Log in to the NineData console.

  2. In the left navigation bar, click on > .

  3. Click on the target or on the right side of column.

  4. In , click on , and configure according to the table below in the pop-up window, then click .

    Parameter
    Description
    Select the data source for the change.
    Select the database for the change.
    Executor of the current task after approval.
    Note: The options in the list depend on the following two situations:
    • If the current data source is configured with development specifications: The options in the list are based on the rule configured in the current specification. This rule is located on the tab. For how to configure development specifications, please refer to Edit Specifications.
    • If the current data source is not configured with development specifications: The options in the list are users who have the permission for the current data source. For more information about permissions, please refer to Configure User Permissions.
    Optional when neither nor is selected as the baseline data source. In this case, you need to select the data source where the task has been executed below, and the executed SQL script will be displayed in the code box below.
    Optional when both and are selected as the baseline data source. Enter the change SQL to be executed or upload a file containing the change SQL.
    • : Enter the SQL statement to be executed directly in the text box.
    • : Click on , select and upload the file containing the SQL statements to be executed.
      Note: After uploading, hover over the file name to the right of the file name and you can choose review (preview file) or delete (delete file).

After the task submission is completed, all sub-steps of the task (such as withdrawal, approval, execution, pause, restart, etc.) are consistent with the SQL Task.

Step Three(2): Advancing the Process

Once all task statuses in the current node reach the final state (i.e., ), you can advance the development pipeline to the next node. If the administrator has enabled in Step 1, even if there are no tasks in the current process, you can force the process to advance to the next process.

  1. Log in to the NineData Console.

  2. In the left navigation pane, click > .

    tip

    If you can't find , please ensure that your console is in organization mode. For information on how to switch from personal mode to organization mode, see Switch to Organization.

  3. Click the tab, then click on the target or under the column.

  4. In the , click on , and in the confirmation window that appears, click again to advance the process to the next node. If there are no more nodes ahead, the development pipeline ends.

Step Three(3): Rollback Process

If the administrator has enabled in Step One, and there are no tasks in the current node (non-initial node) or all tasks have reached a final state, the process can be rolled back to the previous node.

  1. Log in to the NineData console.
  2. In the left navigation bar, click on > .
  3. Click on the target or on the right side of column.
  4. In , click on on the right of more1 > , and then click again in the confirmation window that pops up to roll back the process to the previous node.

Optional Step: Terminate Schema Design and Release Process

During the execution of the Schema Design and Release process, administrators cannot adjust the configuration related to nodes of the process, such as adding nodes, adjusting node order, renaming nodes, deleting nodes, etc. Therefore, if you need to adjust these configurations, you need to terminate the process first.

  1. Log in to the NineData console.
  2. In the left navigation bar, click on > .
  3. Click on the target or on the right side of column.
  4. In , click on in the upper right corner of the page, then click again in the confirmation window that pops up.