cycle / database

Database Abstraction Layer, Schema Introspection, Schema Generation, Query Builders
MIT License
53 stars 22 forks source link

🐛 Index on FK is created despite Relation::$indexCreate=false #113

Closed scapital closed 1 year ago

scapital commented 1 year ago

No duplicates 🥲.

Database

PostgreSQL

What happened?

Even if the options is false, index will be created by Cycle\Schema\Generator\Migrations\GenerateMigrations

Sometimes relation db is used just like a persistence storage, with insert/select by id only operation, not operational db, so index is unnecessary for these cases.

As a workaround, I deleted these indexes in the same migrations. Cycle\Schema\Generator\Migrations\GenerateMigrations will not find any differences, so it look like the bug happen only while generate migrations for new table.

Version

database 2.4.1
PHP 8.2
wapmorgan commented 1 year ago

it was discovered firstly in #82