Database no data

Btw. I am still running an older version and not wappler 5, because I thought I am getting errors, when migrating therefore I want to stay on 4,9 till the project is done.

I have to add, that after deploying my project to digitalocean, including the database - the database table holding my data vanished

What do I need to do, to deploy my local/development database to my server?

It’s not clear what the error is, as your screenshot cuts it.

It can’t just vanish…
How did you find it vanished? Where/how are you looking for it?

Sry, here is the full error code:
{status: “500”, code: “42P01”,…}
code: “42P01”
message: “select “id”, “name”, “link”, “description”, “category”, “logo” from “toollist” - relation “toollist” does not exist”
stack: “error: select “id”, “name”, “link”, “description”, “category”, “logo” from “toollist” - relation “toollist” does not exist\n at Parser.parseErrorMessage (/opt/node_app/node_modules/pg-protocol/dist/parser.js:287:98)\n at Parser.handlePacket (/opt/node_app/node_modules/pg-protocol/dist/parser.js:126:29)\n at Parser.parse (/opt/node_app/node_modules/pg-protocol/dist/parser.js:39:38)\n at Socket. (/opt/node_app/node_modules/pg-protocol/dist/index.js:11:42)\n at Socket.emit (events.js:314:20)\n at addChunk (_stream_readable.js:297:12)\n at readableAddChunk (_stream_readable.js:272:9)\n at Socket.Readable.push (_stream_readable.js:213:10)\n at TCP.onStreamRead (internal/stream_base_commons.js:188:23)”
status: “500”

After the first deployment to digitalocean, including creating a database on the server, the database connection is still there, however the database table not. I had to create a new one and add data again and adding it to the workflow aswell.

Do I need to change the db connection, to the version running on the server?

Your database structure is not transferred on deploy! Only the files of your app are.
Change your target to remote, right click changes and apply latest changes so the database structure can be applied to your remote db:

Also make sure to check the docs for transferring data, after the structure has been applied to the remote target:

1 Like

Great, thanks for the answer. Gonna check tomorrow!

Hi, I tried it and I get unfortunatly an error:

This error means Wappler attempted to create a column that already exists - the database on the target “live” is not empty (or there’s an error in your migration files, and it attempted to alter a column that already had a change)

Can you erase the database and try again?

If it doesn’t work, you’re better just taking note of your database structure (with screenshots or whatever), erasing all migration files, erasing the DB on local/Development target, and re-creating the schema changes to generate new migration files - and erase the DB on remote as well

Thanks for the answer. I tought my database isnt deployed. However I cant find any information about how to do it in wappler? Is there even a function for that? Or do I need to do it in the files directly?

Hi,

Near the Deploy button there should be one with a “power off” symbol - I think that’s the one that also allows you to delete the database.

Let me know how it goes!

P.S.: Make sure the “live” target is selected, to delete the remote DB. And then, if you decide to re-create the migrations from scratch, switch to the Development target, do the same delete procedure, delete the migrations and only then click Deploy again

How can I delete the migration? Got my local env running again, fine like before. I killed the server, but how to delete the migration files?

Do it for each migration. You can also probably navigate to a folder called “migrations” and delete everything inside it :slight_smile: Make sure to click the Refresh button on Wappler so it can see the migrations have been deleted.

Worth noting you might run into a bug where the Refresh button doesn’t actually do nothing - if such happens, you can click in your “db” on that Database Manager window and click “Refresh schema”

Thank you so much! However after changing everything, deleting everything from the server, I deployed the new version locally and then deleted every migration, now it shows an error: error listing the changes…
Wappler_IaspvoeIm8

Wrong order, first delete every migration and then deploy the new version locally :wink:

You now need to delete the local database again using the “power off” button and deploy again (no need to delete the migrations again)

The reason for this message is because Wappler has a special table called “wappler_migrations”, so there are migrations in there that don’t exist on your filesystem (because you’ve deleted them). Deleting the database will erase this table, allowing to start from scratch

I dont know what to say! I did the steps, redeployed everything and now I am having this error and the data is still not available and the table is not shown in the database manager

I would be open to pay you for showing me what i am doing wrong and helping to get it running

1 Like