CREATE TABLE employees
( employee_id NUMBER(6)
, first_name VARCHAR2(20)
, last_name VARCHAR2(25)
CONSTRAINT emp_last_name_nn NOT NULL
, email VARCHAR2(25)
CONSTRAINT emp_email_nn NOT NULL
, phone_number VARCHAR2(20)
, hire_date DATE
CONSTRAINT emp_hire_date_nn NOT NULL
, job_id VARCHAR2(10)
CONSTRAINT emp_job_nn NOT NULL
, salary NUMBER(8,2)
, commission_pct NUMBER(2,2)
, manager_id NUMBER(6)
, department_id NUMBER(4)
, CONSTRAINT emp_salary_min
CHECK (salary > 0)
) ;
CREATE UNIQUE INDEX EMAIL_UNIQUE
ON employees (email) ;
ALTER TABLE employees
ADD ( CONSTRAINT email_pk PRIMARY KEY (email));
SELECT column_name FROM all_cons_columns WHERE constraint_name = (
SELECT constraint_name FROM user_constraints
WHERE UPPER(table_name) = UPPER('EMPLOYEES') AND CONSTRAINT_TYPE = 'P'
);
While in oracle both "EMAIL_UNIQUE" & "email_pk" are listed, the unique index "EMAIL_UNIQUE" is not listed in "INDEXES_Table.sql" after the export schema operation.
Jira Link: DB-13480 Schema used
While in oracle both "EMAIL_UNIQUE" & "email_pk" are listed, the unique index "EMAIL_UNIQUE" is not listed in "INDEXES_Table.sql" after the export schema operation.