Review Policy

Bytebase defines SQL Review Policy for each environment. The SQL Review Policy is essentially a set of SQL lint rules defined in SQL Review Rule. Once configured, Bytebase will check SQL against the configured those rules.

Prerequisites

  • Workspace Admin or Workspace DBA role to configure the Review Policy.

Create Schema Review Policy

info

Note that only ONE policy can be attached per Environment.

There are two ways to create the Schema Review Policy.

One is from Schema Review Policy dashboard in Settings.

schema-review-create-from-policy-dashboard

The other is from Environment dashboard.

schema-review-create-from-environment-dashboard

Change rule level

You can choose one of Error, Warning and Disabled.

Error will block the automatic run of Issue, while Warning will not.

When the rule is Disabled, it will not take effect.

schema-review-change-rule-level

Change rule configuration

There are currently three types of rules that need to be configured.

Regular expression

The rule Table Naming Convention and Column Naming Convention use regular expression as format.

schema-review-change-regex

Template

The rule Index Naming Convention, Unique Key Naming Convention and Foreign Key Naming Convention use Template as format.

schema-review-change-template

Column list

The rule Enforce the Required Columns in Each Table needs Column List.

schema-review-change-column-list

Details of the rules can be found here.

Disable and Delete Schema Review Policy

You can disable the Schema Review Policy to prevent it from taking effect.

After disabling it, you can delete it.

schema-review-disable-and-delete

Edit this page on GitHub

Subscribe to Newsletter

By subscribing, you agree with Bytebase's Terms of Service and Privacy Policy.