Scaling Rails: Setup Multiple Databases with Postgres Logical Replication

How to setup Ruby on Rails with Postgres logical replication: manage schema migrations, database changes and Rails configuration.