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
.
The other is 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.
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.
Template
The rule Index Naming Convention, Unique Key Naming Convention and Foreign Key Naming Convention use Template
as format.
Column list
The rule Enforce the Required Columns in Each Table needs 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.