Bytebase provides customizable SQL lint to check common issues in schema change process.
This document is to show how to configure review rules.
- Free version allows to configure limited review rules. Team or Enterprise version unlocks all review rules.
- Workspace Owner or Workspace DBA role
It currently supports following SQL review rules and see Supported Rules for details:
- Enforce the required columns in each table
- Column type disallow list
- Columns no NULL value
- Disallow changing column type
- Set DEFAULT value for NOT NULL columns
- Disallow ALTER TABLE CHANGE COLUMN statements
- Disallow changing column order
- Use integer for auto-increment columns
- Disallow set charset for columns
- Set unsigned attribute on auto-increment columns
- Column comment convention
- Maximum CHAR length
- Auto-increment initial value
- Limit the count of current time columns
- Require column default value
How it works
Bytebase defines Schema Review Policy for each Environment. The Schema Review Policy is essentially a set of SQL lint rules, and we call SQL lint rule the Schema Review Rule. Once configured, Bytebase will check SQL according to the corresponding Schema Review Policy.
Schema Review only supports SQL checks in Issue now. Support for SQL Editor is coming soon.