Skip to content

Support departure when using it in environments together with apartment and octopus #37

@w32-blaster

Description

@w32-blaster

Apartment gem is used for handling multi tenancy on database level. This means, having multiple databases which should have the same schema.
Octopus can be used to take care of master / slave mysql structure and route the queires to the right node (shard)
When using departure in an environment together with apartment and octopus, we are getting the following error:

ActiveRecord::RecordNotUnique: Mysql2::Error: Duplicate entry '20180109094356' for key 'unique_schema_migrations': INSERT INTO `schema_migrations` (`version`) VALUES ('20180109094356'): INSERT INTO `schema_migrations` (`version`) VALUES ('20180109094356')

Doing some investigation, it looks like we are always trying to connect to the same database (the main database which is set in the config file) and not to the one, which was selected by apartment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions