Rails 6 Second Database without Run Migration

Viewed 184

Recently try Rails 6 feature for multiple database : With database.yml like this

development:
  primary:
    adapter: postgresql
    encoding: unicode
    username: hoho
    password: hoho
    host: X.X.X.X
    port: 5432
    pool: 5
    database: hoho_development
  secondary:
    adapter: postgresql
    encoding: unicode
    username: haha
    password: haha
    host: Y.Y.Y.Y
    port: 5432
    pool: 5
    database: haha_development
    migrations_paths: db/secondary_migrate

although db/secondary_migrate is empty..when i execute rails db:migrate, it still write ar_internal_metadata and schema_migrations.

is there any way to avoid this? in my usecase i don't want to write any new table to the second database, just want to read and write to existing tables that created not from rails migration.

0 Answers
Related