multi-tenant: New migration doesn't run on tenant

Ok here’s the gist of my situation. I created a set of new migrations and upon issuing php artisan migrate --tenant=all it doesn’t migrate the tenant database with the new migrations. Please see steps below.

PS. This only works if you apply my PR: https://github.com/hyn/multi-tenant/pull/103

  1. blank master database
  2. no tenant databases yet
  3. I have migrations after hyn/multi-tenant migrations.
  4. I then run multi-tenant:setup as seen below to create new tenant. New migrations as highlighted in the screenshot shows at the bottom. No surprises there since that’s how it should work. screen shot 2016-06-11 at 9 36 42 am
  5. I then ran migrations for tenant php artisan migrate --tenant=all
  6. As you can see on the screenshot the 3 migrations from above doesn’t appear in the tenant migration. screen shot 2016-06-11 at 9 36 59 am
  7. I reset the master database, deleted all the tables, removed the newly created tenant.
  8. I then tested it out and renamed all 3 migrations in such a way that it will show up first on the list and that the hyn/multi-tenant migrations will be shown last. As you can see on the screenshot it works as expected on the master database, the 3 migrations are now shown first. screen shot 2016-06-11 at 9 42 40 am
  9. I then tried again and run the migrations on the tenant created. This time the 3 migrations hows on top of the hyn/multi-tenant migrations as expected. screen shot 2016-06-11 at 9 43 08 am

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (16 by maintainers)

Most upvoted comments

I am using Laravel 5.3 and Hyn 2.0* and new migrations are not run on my tenant databases.

I don’t get any errors about failed tables etc.

Once I rename the migration to 2014_something, it runs perfectly on the tenants.