Issues deleting placeholder Docker tables

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.

Images table
Screen Shot 2022-04-22 at 10.19.29 am
Screen Shot 2022-04-22 at 10.19.35 am

Cars table
Screen Shot 2022-04-22 at 10.07.42 am
Screen Shot 2022-04-22 at 10.07.53 am

Countries table
Screen Shot 2022-04-22 at 10.21.14 am

The drop column images, did you create the migration manually or was it generated by Wappler?

Sorry, I’m not 100% sure what you mean, but I just did the delete action in the Database Manager.

Ok, understood. Can you post a screenshot of your database changes? It might be useful for others to get a sense of your database current state
Screenshot

@George Wappler failed to generate knex.down? Check the first 2 images of this topic

@Apple - Here’s the full list of changes.

What a huge mess :sweat_smile:

Perhaps I’d first suggest to make a backup of your project before continuing.

Do you have important data on your database or is it ok to start fresh from the beginning?

And then delete these migrations:

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”:
Screenshot

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

2 Likes

@Apple - Thanks for your detailed suggestions.

And I totally agree it is a mess :laughing:

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.
Screen Shot 2022-04-22 at 11.07.12 am

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:
Screenshot

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)

2 Likes

I just noticed that there is a ‘current’ indicator and it says I’m currently on the ‘Added new role table’ change.

Will do. Thank you very much for your help @Apple!

1 Like