0 votes

I am experiencing an issue with your tool, specifically concerning the generation of the index length attribute option. The generated output is not as expected.

I need this

[ORM\Index(name: "array", columns: ["array"], options: ["lengths"=>[100]])]

If i put [100] the result is:

[ORM\Index(name: "array", columns: ["array"], options: ["lengths"=>"[100]"])]
in Solved by (190 points)
recategorized by

Thank you for the report. Can you please send us a link to the documentation where is this option described? Thanks

I cant find any documentation in doctrine, but I have this stackoverflow post:
https://stackoverflow.com/questions/66045142/index-length-in-doctrine-orm

you have another discussion in this forum, but I use attributes and no annotations:
https://www.skipper18.com/support/4152/setting-key-index-length?show=4152#q4152

thx.

If you check line 100 and line , you will see that "lengths" needs to be an array.
https://github.com/doctrine/dbal/blob/3.6.x/src/Schema/Index.php#L100
https://github.com/doctrine/dbal/blob/3.6.x/src/Schema/Index.php#L362

If it's not an array, it will throw an error when executing the migrations diff:

In Index.php line 363:

[TypeError]
array_filter(): Argument #1 ($array) must be of type array, int given

1 Answer

0 votes

Thanks for reporting this issue. The fix is available in the latest beta here:

https://www.skipper18.com/support/402/downloads-skipper-beta

by Skipper developer (141k points)