# Migrate:multisite schlägt bei der zweiten Site fehl, wenn von Grund auf migriert wird

**URL:** <https://meta.discourse.org/t/migrate-multisite-fails-on-second-site-when-migrating-from-scratch/108559>\
**Category:** Bug\
**Created:** [7. Februar 2019 um 03:20 UTC](https://meta.discourse.org/t/migrate-multisite-fails-on-second-site-when-migrating-from-scratch/108559 "2019-02-07T03:20:37Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [7. Februar 2019 um 22:34 UTC](https://meta.discourse.org/t/migrate-multisite-fails-on-second-site-when-migrating-from-scratch/108559/11 "2019-02-07T22:34:51Z")

</div>

We got to catch every occurrence of corruption of our schema cache, cause its like a little timebomb waiting to explode.

- migration 1 … corrupts schema cache  
3 years pass
- migration N … incorrectly uses active record models (which is not something we should be doing) and then explodes.

The best thing is simply never ever to touch AR models in migrations. I would be far more open to a fix that hard bans that from migrations and deal with the pain of fixing this in the existing migrations we have.

---

_[View the full topic](https://meta.discourse.org/t/migrate-multisite-fails-on-second-site-when-migrating-from-scratch/108559)._
