question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Salesforce router causing issues with migrations

See original GitHub issue

Hi,

Let’s start by thanking everyone working on this project : great work!

This is my first issue with the library : i’m doing some completely unrelated work in an other database (MySQL), including renaming some models. When I apply the migrations, I have a crash. It comes from the Salesforce router

  File "python3.5/site-packages/django/db/utils.py", line 291, in allow_migrate
    allow = method(db, app_label, **hints)
  File "python3.5/site-packages/salesforce/router.py", line 65, in allow_migrate
    model = apps.get_model(app_label, model_name)
  File "python3.5/site-packages/django/apps/registry.py", line 207, in get_model
    return app_config.get_model(model_name, require_ready=require_ready)
  File "python3.5/site-packages/django/apps/config.py", line 170, in get_model
    "App '%s' doesn't have a '%s' model." % (self.label, model_name))
LookupError: App 'XXX' doesn't have a 'YYYY' model.

Not sure what’s the purpose of “allow_migrate” precisely. But what’s surprising is that even by calling ./manage.py migrate --database default, the issue remains (“default” being my SQL database)

The only solution I’ve come up with is to remove the salesforce router from settings.py dynamically when applying migrations…

Any idea what could cause such issue?

Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hynekcercommented, Jun 19, 2019

I prepared a fix hynekcer/ignore-migrations (temporarily on March 16) (EDIT: moved to PR #233 and merged f835680a), but still I need to write a test. It is not easy to write a simple test for migrations. This remains open.

0reactions
matthew-a-dunlapcommented, May 28, 2019

Thanks much for the new release, works great!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Salesforce Data Migrations Fail and How to Fix It -
Our blog discusses the key 5 reasons why your Salesforce data migration project may fail and how to overcome those issues.
Read more >
Salesforce Data Migration Tips and Best Practices - Sikich LLP
Example: This is a common issue in migrating Contacts from Outlook into Salesforce. Outlook users often have the same Contacts in their Outlook....
Read more >
Common Migration Issues | Ant Migration Tool Guide
There are a number of common issues you may run into when migrating metadata and deploying changes. These issues can be grouped into...
Read more >
Migrate Legacy Data Without Screwing It Up - Toptal
In this article, Toptal Software Engineer Marian Paul provides 10 tips for successful legacy data migration to Salesforce.
Read more >
Switching from Dynamics to Salesforce: Migration Tips & Tricks
Thinking of switching from Dynamics to Salesforce? Read our guide on how to migrate from Microsoft Dynamics to Salesforce smoothly and fast.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found