2

I am working on a multi tenant rails app where the tenants have been created using Apartment gem. Whenever a new tenant is created, Apartment creates all the tables in the new tenant.

But, when I add a new table and run db:migrate, one of the gems, tries to recreate the tables in the tenants and it fails because the table already exists(created by Apartment). It throws PGSQL error :: table already exists.

  • How do I tell that particular gem to not run its migrations as its tables have already been created by Apartment?

  • Is it possible to remove/stop/halt migrations for a particular gem ?

OR,

  • Is it possible to ask Apartment gem to not create the tables so that the other gem can create them?
jumpa
  • 658
  • 1
  • 9
  • 22
  • How are you creating and migrating the Tenants? My suspicion is however you have it setup is not updating the migration table for the tenants. – tagCincy Jul 06 '15 at 17:54
  • I am creating using Apartment::Tenant.create('tenant_name') . It creates all the tables for me. I don't know if its updating the migration table. I will try and figure that out. – jumpa Jul 06 '15 at 18:21

0 Answers0