Naming conventions¶
Please respect the following naming conventions when modifying the CTA Catalogue schema.
Warning
Some versions of Oracle do not allow element names longer than 30 characters.
PRIMARY KEY constraints¶
PRIMARY KEY constraints name should always finish with _PK
Example:
FOREIGN KEY constraints¶
FOREIGN KEY constraints name should always finish with _FK
Example:
CREATE TABLE TAPE(
LOGICAL_LIBRARY_ID NUMERIC(20, 0),
CONSTRAINT TAPE_LOGICAL_LIBRARY_FK FOREIGN KEY(LOGICAL_LIBRARY_ID) REFERENCES LOGICAL_LIBRARY(LOGICAL_LIBRARY_ID)
);
UNIQUE constraints¶
UNIQUE constraints name should always finish with _UN
Example:
CREATE TABLE STORAGE_CLASS(
DISK_INSTANCE_NAME VARCHAR2(100),
STORAGE_CLASS_NAME VARCHAR2(100),
CONSTRAINT STORAGE_CLASS_DIN_SCN_UN UNIQUE(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)
);
NOT NULL constraints¶
NOT NULL constraints name should always finish with _NN
Example:
CHECK constraints¶
CHECK constraints name should always finish with _CK
Example:
CREATE TABLE TAPE_POOL(
IS_ENCRYPTED CHAR(1),
CONSTRAINT TAPE_POOL_IS_ENCRYPTED_BOOL_CK CHECK(IS_ENCRYPTED IN ('0', '1'))
);
INDEX names¶
INDEX names should always finish with _IDX
Example:
SEQUENCE names¶
SEQUENCE names should always finish with _SEQ
Example: