Sharing some naming conventions is a key factory in efficient team collaboration. This rule checks that all constraint names match a provided
regular expression.
Noncompliant code example
With format_primary_key
set to "pk_[a-z]++ " and format_foreign_key
to "fk_[a-z]++ ".
CREATE TABLE employee(
first_name VARCHAR2(42),
last_name VARCHAR2(42)
department_id INTEGER CONSTRAINT department_fk REFERENCES department,
CONSTRAINT fullname_pk PRIMARY KEY (first_name, last_name);
);
Compliant solution
CREATE TABLE employee(
first_name VARCHAR2(42),
last_name VARCHAR2(42)
department_id INTEGER CONSTRAINT fk_department REFERENCES department,
CONSTRAINT pk_fullname PRIMARY KEY (first_name, last_name);
);