purge all data in railway postgres

a year ago

is there an eazy way to do this? I want to be able to clear up the database easily and also disable backups

0 Replies

a year ago

wipe the volume from within the volume setting, additionally railway does not take any backups for you in any way


a year ago

can volume be wiped programmatically or through cli?


a year ago

you can wipe it from the API yeah


a year ago

with cli no?


a year ago

the CLI doesn't offer that functionality afaik


a year ago

oof. I'm US based

1263015987775799300


a year ago

only auth'd no playground?


a year ago

that's okay because that's not how the API works


a year ago

well most graphql apis take you to a playground if it's a GET request


a year ago

instead of blocking you


a year ago

can you tell me your usecase please?


a year ago

graphiql


a year ago

example https://graphql.github.com/ redirects you to a playground if it's GET


a year ago

can you tell me your usecase?


a year ago


a year ago

i want to explore the schema so I can construct the necessary query in order to wipe volume


a year ago

nice thanks


a year ago

i meant your usecase for wiping the volume


a year ago

oh sorry


a year ago

I'm creating railway deployment guide then a template for this https://github.com/joshstevens19/rindexer

while developing that I find myself deploying frequently and needing a fresh database. Basically to make sure indexing and db sync is working


a year ago

I would not need that in production


a year ago

if its just for development, why not just click wipe volume in the volume settings?


a year ago

i deploy a lot within my shell


a year ago

rarely use the dashboard


a year ago

gotcha


a year ago

mutation volumeInstanceWipe($volumeInstanceId: String!) {
  volumeInstanceWipe(volumeInstanceId: $volumeInstanceId)
}
{
  "volumeInstanceId": "id_here"
}

a year ago

thanks


a year ago

can't find volume id


a year ago

open the volume and the id is in the url


a year ago

it worked and also

1263021666120765400


a year ago

yes, there is no wipe option


a year ago

so this just removes the volume entirely?


a year ago

yep


a year ago

silly question, now that I wiped the volume it removed the deployment. Understandable. What do to create a new deployment?

1263022186642407400


a year ago

it should not remove the deployment, I just tried it and it redeployed


a year ago

but simply redeploy it


a year ago

argh I ran volumeDelete(volumeId: $volumeId) instead of volumeInstanceWipe


a year ago

but I don't see a volumeInstanceWipe in the schema


a year ago

1263022913033076700


a year ago

it doesnt need to be, use the internal endpoint


a year ago

that deleted the volume entirely instead of just clearing data


a year ago

yes, as you mentioned you called the wrong mutation


a year ago

i couldn't do this without you


purge all data in railway postgres - Railway Help Station