Rate This Document
Findability
Accuracy
Completeness
Readability

Source Code SQL Writeback Patch

After migrating source code SQL statements, download the patch file generated by the tool and apply the SQL statement modifications in the patch file to the source file.

Method 1: Use IntelliJ IDEA to apply the patch.

This section uses a project for which Git is used as the version control software.

  1. Open the project and check that the source code has been correctly loaded.
  2. Choose Git > Patch > Apply Patch..., select the patch file, and select the target source file.

    For a non-Git project, choose VCS > Apply Patch....

    Figure 1 Applying a patch (for a Git project)
    Figure 2 Selecting the patch and source file
  3. After the patch is applied, check whether the updated code is correct to ensure that the patch functions properly.
    Figure 3 Source code modification result

Method 2: Run the patch command to apply the patch.

Check that the patch command has been installed. You can use the patch command provided by Git Bash or download and install the patch command.

  1. Go to the root directory of the project generated after decompressing the source package and run the following command:
    patch -p1 < /path/to/xxx-devkit-sql.patch
    • -p1: ignores the level-1 directory in the patch file path.
    • /path/to: patch file directory.
    • xxx: patch file name. Replace it with the actual name.
  2. After the patch is applied, check whether the updated code is correct to ensure that the patch functions properly.

Method 3: Run the git command to apply the patch.

Check that the git command has been installed.

  1. Go to the root directory of the project generated after decompressing the source package and run the following command:
    git apply -p1 /path/to/xxx-devkit-sql.patch
    • -p1: ignores the level-1 directory in the patch file path.
    • /path/to: patch file directory.
    • xxx: patch file name. Replace it with the actual name.
  2. After the patch is applied, check whether the updated code is correct to ensure that the patch functions properly.