Skip to content

Using merge_orm_schema with two connections creates incomplete schema #772

@fritz-gerneth

Description

@fritz-gerneth

Not sure if this belongs here or in the bundle, but the affected code is in this repo.

In our testing environment ./console doctrine:schema:create creates in incomplete schema. The eventstore table is missing in the generated schema.

Setup:

  • merge_orm_schema: true
  • Two connections, one for the app, one for the event store
  • As part of test setup, we run ./console doctrine:schema:update --force --env=test

The generated SQL code does contain the base table for the subscriptions, but not for the event store. I tracked this down to this check. The schema update uses the default connection, not the store connection, hence the store is not set up. Disabling this check makes this function work as expected.

This is also an inconsistency to the SubscriptionStore which does not perform this check, hence the subscriptions table is part of the setup.

We cannot use the ./console event-sourcing:schema:update command, as this will delete the tables created in the main app schema. I suggest to remove this check - it should not be necessary for the schema setup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions