I was trying to clean up the database in my new app by deleting the placeholder Docker tables - cars, countries and images.
After applying databased changes, the cars and countries tables disappeared, but the images table remained and presented an error (I forgot exactly what).
Then I tried rolling back which didn’t help as it was still missing. Then the other tables I originally deleted (cars, countries) are now appearing and can’t be deleted now.
I’m guessing I shouldn’t have done a bulk delete for multiple table, but can someone please suggest a way to remove these tables that are in error and can’t be deleted?
Below are the error messages I’m getting for them.
So you should be in a state before you started deleting the placeholder tables. You can click “Deploy” to start the database and Wappler app, and then you can click “Refresh schema” and then run the migrations by clicking “Apply Latest Changes”:
Now it’s a good time to make a 2nd copy of the project.
Next, you can try again deleting the tables cars, countries and images at once. If it fails somehow post here the error and migration file
Before reading your last message, I thought I’d try to create a new table that I was planning to do before I got caught up on this deleting issue.
After creating the new ‘roles’ table, the ‘images’, ‘cars’ and ‘countries’ tables, automatically disappeared from the tables list.
I restarted Wappler to make sure it wasn’t an anomaly and those tables are now gone.
I promise you I was hitting the ‘refresh’ button in the Database Manager constantly, but when I applied database changes for this new table, the other ones disappeared.
I’m not sure if I should still delete those old migrations you mentioned if everything is working now. Or maybe I’ll do a backup like you said, delete the migrations and see if all is OK. I’m still early days in my app and don’t have any data, so it won’t be any drama there.
My experience tells me such button doesn't quite behave as we intend, I regularly use this one instead:
At this point, I recommend you to backup your project and try to drop the database and re-create it (the instructions in my previous post) and try to apply the migrations (changes). This is because you don't actually know if the migrations are properly working, and then you'll face issues when you try to run the migrations in another target (e.g.: production server)