Any way to dismiss the Schema Mismatch msg in Beta Editor?

What I’m dealing with:

This message is perpetually shown in the Data Tables section of my app but I can’t figure out why it’s saying my app’s source code is expecting very outdated objects (which i don’t see in any of my source code; I’ve searched for them to make sure).

The message seems to be saying that my app’s current setup (which works fine) is incorrect, and prompting me to revert my app’s source code back to a schema that no longer exists, as far as I can tell.

What I’ve tried and what’s not working:

As a test, I cloned my app as a backup and then followed the ‘Resolve’ prompt in the message, just to see if maybe I didn’t understand what it was suggesting and maybe would work. It prompted completely broke my app so that the data tables no longer matched my code (which is what I thought would happen).

I don’t know what this message is trying to do but I now know for sure that blindly following it breaks what I have.

At this point, my cry for help is two-fold:

  1. Is there any other way to resolve or deal with this schema mismatch issue that I could be overlooking? I searched previous threads and haven’t found any yet that have been conclusively addressed.

  2. If there isn’t (and it’s not correct or alerting me about a real issue that needs fixing), is there a way for me to get rid of this message? It’s very hard to ignore as it’s this giant alert screaming at me every time I go into my Data Tables.

Thanks in advance y’all :slight_smile:

M

What is shown under the source code schema is what Anvil has saved to the anvil.yaml file as a backup of your schema. What is shown under the default database schema is what it actually in the default database.

Generally when this shows up for me after I’ve just made a change to the default database schema the right thing to do is to click “The schema of Default Database is correct”. That updates the anvil.yaml file to match, and the message goes away for the moment.

There are times when the other answer is correct, but those are generally when you’re migrating changes from one database to another (e.g. from a development database to a production database).

Edit: the “Resolve” prompt is a shortcut to click “The schema of the source code is correct”, which is why it didn’t work for you. That undid the changes you’d just made to the database.

5 Likes

Hi @momoko,

@jshaffstall is correct, but I also want to add that we are aware that the Schema Mismatch alert is being triggered at times when it shouldn’t be. This is on our list to fix!

3 Likes

Wow, I am stunned that all this time it never once occurred to me that the giant blue & red options in the mismatch alert were actually clickable buttons and Calls-To-Action! This whole time they looked like static blocks of text to me. How embarrassing :laughing:

@jshaffstall thank you so much for the clarification as this turned out to be a 1-click instant fix!

@brooke I don’t know if my situation represents the average user, but if it does, I bet adding a line or two of copy to the alert that makes it clear that it’s asking you to confirm which scenario is correct would help some app-dev newbs like myself.

Thank you again for the help!

M

1 Like

Messages are not clear, buttons don’t look like buttons, they show up when they shouldn’t, the workflow is cumbersome…
There have been many questions about this subject.
You are not alone, and it’s not embarrassing :slight_smile:

3 Likes

Yup. From my perspective, both schemas are correct, for their respective contexts. And both schemas are part of my App! I’m planning to have at least 3 schemas, and every single one of them will be correct, in their own context, in my App. It won’t be a conflict with “my App” as a whole!

At least the messages are confusing enough to make folks look closer, and ask for help, rather than make a bad choice look good.

As @stefano.menci has said, it’s not embarrassing! I also was confused by the screen when I first encountered it, and I also didn’t realize the text were buttons. I’ve already logged an issue internally, so redesigning it is definitely on our list!

Thank you, @brooke. There may be only two buttons now, but in reality, there are more than two ways to resolve the matter. For example, the proper solution might sometimes be to select a different database.