influitive / apartment

Database multi-tenancy for Rack (and Rails) applications
2.67k stars 463 forks source link

Substitute tenant name in pg dump #537

Closed shterrett closed 6 years ago

shterrett commented 6 years ago

Address https://github.com/influitive/apartment/issues/532 for Postgres 10.3. See https://github.com/influitive/apartment/pull/536 for more details.

I was trying to run only the postgres tests locally and was having some trouble with some where the Apartment.connection.schema_search_path = <search_path> call didn't actually have an effect on the database. I'm curious to see if the tests pass on CI, or if there's another issue with my environment.

PaulOstazeski commented 6 years ago

I'm using this fork in production. It works! Hurray!

ccorn90 commented 6 years ago

Me too! I hope it can be reviewed soon.

meganemura commented 6 years ago

I’ll review this ASAP.

meganemura commented 6 years ago

@shterrett Would you please write some tests?

shterrett commented 6 years ago

@meganemura I'd be happy to - I'm not sure where though. I think this is covered by the "create a new tenant" tests which were failing under the postgres version I was running. Can you point me in the right direction?

Also, I don't know why the Jenkins build failed. The errors have to do with database creation; the commit I pushed this morning simply added some comments to the config/initializers/apartment.rb template.

meganemura commented 6 years ago

I think this build failure is related to the release of mysql2 0.5.0 gem. See this note. I'll pin it in the gemfiles/* soon.

meganemura commented 6 years ago

Thanks @shterrett, @cyrill62 (for #536) and @aldrinmartoq (for reporting #532).