Digital Ocean 'unmanaged' database how to drop tables?

(Node.js Docker mySql)
My first project…

Spent long time building on my local server without adding production remote docker target. Oooops.

I dropped the local sql sample tables and added my own tables/fields relationships etc.
Months later…
After setting up the remote target and deploying my app to it the remote db (on Digital Ocean)
contains only the sample tables (cars users countries etc).

I have gone through the process of applying changes in the database manager for the remote target location. I cannot delete the sample tables and get the error message:

‘Invalid migration: 20210707104532_delete sample tables.js must have both up and down function’

How do I delete these on the remote server?

I have managed to remove the unwanted tables but I have 1 field that exists in the remote db and not oin the local.

I want to delete it I have gone through the changes and tried to reverse them but knex throws up errors

How would I delete the unwanted remote field using knex?

Firstly if you didn’t want the sample data in your database - you should just check the option for that in the docker database options.

Next you really should do schema changes to your local development database only. When done just switch to the live target and apply those changes.

This way you ensure that you both databases are in sync with their schema.

yep got that George…All sorted, however, I somtimes get an a knex error even when doing it the proper way…is there a tutorial on knex somewhere? as Im not 100% clear what .up and .down actually siginify.
Thanks George :slight_smile:

I don’t think wappler DB manager is the best way to manage your database … There’s plenty of first class free database management tools out there that I’d recommend instead. Likewise, for building remote API calls (JSON), I’d suggest something like insomnia or postman and then simply plugging into the server connect when you know they’re working. Try to use the best tools for each job then let’s wappler glue it all together at the end

2 Likes