Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ORACLE] A Unique index which is also a primary key is not migrated #571

Open
chetank-yb opened this issue Nov 8, 2022 · 0 comments
Open
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@chetank-yb
Copy link
Contributor

Schema used

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.

@github-actions github-actions bot removed the bug Something isn't working label Nov 8, 2022
@kneeraj kneeraj added documentation Improvements or additions to documentation and removed triage Needs to be triaged labels Nov 17, 2022
@aishwarya24 aishwarya24 reopened this Jan 6, 2023
@github-actions github-actions bot added the triage Needs to be triaged label Jan 6, 2023
@amit-yb amit-yb removed the triage Needs to be triaged label Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants