We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It was detected a case when down-migration was generated with wrong operations order. It is actual for case when it is used named index.
For example we have named index item_resource_some_index with 2 fields and we want to add one more field for index - deleted_at.
item_resource_some_index
deleted_at
Base entity:
/** * @Cycle\Entity( * table="item_resource", * repository="App\Repository\ItemResourceRepository" * ) * * @Cycle\Table( * indexes={ * @Cycle\Table\Index( * columns={"resource_id", "item_uuid"}, * unique=true, * name="item_resource_some_index" * ) * } * ) */ class ItemResource { /** * @Cycle\Relation\BelongsTo(target=Item::class, innerKey="item_uuid") */ public Item $item; /** * @Cycle\Relation\BelongsTo(target=ResourceEntity::class, innerKey="resource_id") */ public ResourceEntity $resource; ... }
When we add 3rd field and run cycle:migrate we will receive:
cycle:migrate
class ModifyNodeEstimateIndexMigration extends Migration { public function up(): void { $this->table('item_resource') ->addIndex( ["resource_id", "item_uuid", "deleted_at"], [ 'name' => 'item_resource_some_index', 'unique' => true ] ) ->dropIndex(["resource_id", "item_uuid"]) ->update(); } public function down(): void { $this->table('item_resource') ->addIndex( ["resource_id", "item_uuid"], [ 'name' => 'item_resource_some_index', 'unique' => true ] ) ->dropIndex(["resource_id", "item_uuid", "deleted_at"]) ->update(); } }
On down migration new index can't be created while old same-named index exists
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It was detected a case when down-migration was generated with wrong operations order.
It is actual for case when it is used named index.
For example we have named index
item_resource_some_index
with 2 fields and we want to add one more field for index -deleted_at
.Base entity:
When we add 3rd field and run
cycle:migrate
we will receive:On down migration new index can't be created while old same-named index exists
The text was updated successfully, but these errors were encountered: