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

Length of index names in Oracle 12.2 or higher. #542

Open
daanbonke opened this issue Nov 12, 2019 · 4 comments
Open

Length of index names in Oracle 12.2 or higher. #542

daanbonke opened this issue Nov 12, 2019 · 4 comments

Comments

@daanbonke
Copy link

daanbonke commented Nov 12, 2019

Summary of problem or feature request

In Oracle 12.2 or higher the name length of indexes increased from 30 to 128 bytes.
However migrations will still cut off index names longer than 30 bytes.

System details

Oracle database >= 12.2

@yajra
Copy link
Owner

yajra commented Jan 4, 2020

Thanks for this info. I think we can enhance the package and add an ENV config that defaults to 30 for max object name length.

Is this info also applicable for table, column, sequence name, etc?

-- Edit --

It seems like it's applicable on all objects as per SO post https://stackoverflow.com/questions/756558/what-is-the-maximum-length-of-a-table-name-in-oracle.

@mdemori
Copy link

mdemori commented Nov 3, 2020

Summary of problem or feature request

this is still an issue.

Currently with Oracle 12 the table name can be created with more than 30 characters but all objects like trigger, sequence etc are still restricted to 30 characters. As example a table can be named as

LONG_TABLE_NAME_WITH_A_VERY_LONG_NAME_TEST01

but objects like sequence and trigger are created like :

LONG_TABLE_NAME_WITH_A_VERY_LO

This lead to a situation where if you have two long table with same 30 char initial part every object will fail during migrations.

So, as example:

LONG_TABLE_NAME_WITH_A_VERY_LONG_NAME_TEST01

LONG_TABLE_NAME_WITH_A_VERY_LONG_NAME_TEST02

LONG_TABLE_NAME_WITH_A_VERY_LONG_NAME_TEST03

all subsequential migration after LONG_TABLE_NAME_WITH_A_VERY_LONG_NAME_TEST01 will fail because all objects already exists as LONG_TABLE_NAME_WITH_A_VERY_LO (triggers and sequences)

System details

Oracle database >= 12.2
yajra/laravel-oci8 Version 7.0.1

@mdemori
Copy link

mdemori commented Nov 15, 2020

@yajra sorry if I bother you, this issue is in the right place ? I had the suspect that I put this issue in the wrong place and is passed unnoticed... if is not this case please sorry again

@yajra
Copy link
Owner

yajra commented Nov 17, 2020

@mdemori no worries, this is the right place I guess. Anyways, I might not be able to work on this yet so if you can, please do not hesitate to submit a PR. You can continue working on the PR I created #555.

Some items on the PR that needs to be updated:

  1. Use config instead of fetching via env.
  2. Tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants