nocodb icon indicating copy to clipboard operation
nocodb copied to clipboard

Bug : Identifier name is too long when creating relation between tables

Open o1lab opened this issue 1 year ago • 3 comments

Discussed in https://github.com/nocodb/nocodb/discussions/8691

Originally posted by eugeneihde June 11, 2024 I want to create a relation between to tables in nocodb. So i got into the table and created a new field with the field type Links. I selected the Has Many Relationship and selected the table i wanted to link to. Now when i tried to save i got this error message:

alter table nc_v76b___StrassenanschriftInland add index nc_v76b___strassenanschriftinland_nc_v76b___codeartanschrift_id10_index(nc_v76b___CodeArtAnschrift_id10) - Identifier name 'nc_v76b___strassenanschriftinland_nc_v76b___codeartanschrift_id10_index' is too long

Is there a way to fix this?

o1lab avatar Jun 11 '24 08:06 o1lab

As of now there isnt a work around for this I guess? Its my first "base" with my first 2 tables and a lookup field and I am stuck immediately for what ever comes next ...

joeldebruijn avatar Oct 15 '24 16:10 joeldebruijn

@joeldebruijn Our workaround was to temporarily shorten the names of the two tables before establishing the relation. After the relation was created, we renamed the tables back to their original names.

For example one table was named StrassenAnschriftInland and we temporarily shortened it to StrAnschInland.

eugeneihde avatar Oct 15 '24 16:10 eugeneihde

Oh that would be great and minimal workaround, will test!

joeldebruijn avatar Oct 15 '24 16:10 joeldebruijn

Thanks for bringing this up! The issue was related to index creation, and we’ve addressed it by specifying a custom index name. This should resolve the problem.

You can try out the following PR build to verify the fix:

docker run -d -p 8888:8080 nocodb/nocodb-timely:0.262.0-pr-10632-20250225-1235

pranavxc avatar Feb 25 '25 12:02 pranavxc