Refreshing Database Schema

Hi there!

I'm still pretty new to Wappler. Hopefully you can give me some help. :smiley:

I designed a "sign up" form. It inserts a phone number in the DB just fine, unless someone used a dash (I can explain later why I might leave dashes in for now) .

Then, I realized that I accidentally made my DB field a "int" (or number) field instead of "text."
I went into MySql and made the change.

I tried to load the form and enter some data, and still got the warning/error, "Please enter a valid number."
Oh - I figured that Wappler probably stored that information somewhere.
I noticed that "records.php" is storing information about the table that is incorrect (the old "number" instead of "text"):

 "table": "CustPhones",
            "column": "phone",
            **"type": "number",**
            "value": "{{$_POST.PhoneID}}"

So, I read in the forums that I needed to do a Database refresh.
Now I've done that a few different times. But, it's still throwing the error, and I noticed that records.php doesn't change.

Do I just need to change records.php manually? I thought Wappler would update it.

Open the Action and click on the ā€˜Database Connection’ with the issue and click the button ā€˜Connection Options’. Click ā€˜Save’ so it refreshes the schema and uploads the new file. Then click on the same ā€˜Database Connection’ and a confirmation message will be shown informing you that the ā€˜Linked Action File’ is not saved’. Click ā€˜Yes’ to save it first. Then try your page again and see if everything works fine…

:slight_smile:

Thanks!
But, hmmm - Doesn’t seem to work for me.

I attached an image, to see if I’m doing it right.
I click on the action step where the ā€œDatabase insertā€ is located…
Then click on ā€œDatabase Connectionā€ then ā€œConnection Optionsā€ (below) and then SAVE.
Then I reclick on The DB connection… and save it.

I did that, and it said it saved the file… but nothing changed
SEE THE PICTURE:

Bummer. Yes that should have worked…? Maybe worth waiting for @Teodor or @George to respond @sophos707

If you are using Wappler’s Database Manager - just click on the refresh on its toolbar.

Otherwise you can go to the insert/update database action and click refresh on its dialog.

1 Like

I tried going to the Wappler Database Manager, clicked on the DB and then refresh, a few different times. Then saved it.

I also went to the database action and click on query builder and refreshed from there.
It didn’t work.

Hmm

It seems like something else may have gone wrong in this intermediate period.

My database connection lost all it’s information in Wappler and I had to reenter it.

Even after that, the form doesn’t submit even when the data is entered correctly.
I"m pretty confused now.

How did you change the field type in your database in first place?

With the database manager? And did you apply the changes?

Maybe your update was just never applied?

I changed it in PHP MyAdmin.

I don’t know what happened. I went ahead and closed Wappler. Deleted some of the input actions. Restarted my computer, closed all open files… and now it seems to be working.

No idea why.

1 Like