Delete tables/databases on railway

theo-nejm
HOBBY

a year ago

How can I delete a table or reset my database on railway?
I want to re-migrate all my data.

0 Replies

theo-nejm
HOBBY

a year ago

75f448f4-88c9-4d82-b428-61740d90e40c


theo-nejm
HOBBY

a year ago

I can create new tables, but i dont know how to delete existing ones


a year ago

you want to wipe your entire database?


theo-nejm
HOBBY

a year ago

yes, delete all tables to migrate them again


a year ago

wipe the volume then


theo-nejm
HOBBY

a year ago

but i dont want to remove the service because of the envs


theo-nejm
HOBBY

a year ago

i dont want to re-create the mysql image


theo-nejm
HOBBY

a year ago

cant I just drop the database?


a year ago

yep, wipe the volume, this will give you a brand new database


theo-nejm
HOBBY

a year ago

how?


a year ago


theo-nejm
HOBBY

a year ago

oh


theo-nejm
HOBBY

a year ago

that helps


theo-nejm
HOBBY

a year ago

tks


theo-nejm
HOBBY

a year ago

OH I LOST MY DATA


theo-nejm
HOBBY

a year ago

just kidding


theo-nejm
HOBBY

a year ago

lmao


theo-nejm
HOBBY

a year ago

thanks, Brody


a year ago

in preparation of you saying something like this i had edited my above message to be clearer haha


theo-nejm
HOBBY

a year ago

hahaha


theo-nejm
HOBBY

a year ago

im facing a new issue


theo-nejm
HOBBY

a year ago

my healthcheck is not working for any reason


a year ago

for the record we wouldnt have been able to do anything anyway


theo-nejm
HOBBY

a year ago

locally my route is working perfectly


theo-nejm
HOBBY

a year ago

the /health app route is working fine, returns a 200


theo-nejm
HOBBY

a year ago

oh I can mind what is happening


theo-nejm
HOBBY

a year ago

probably the service is not starting because I didnt set up a redis service on railway yet


theo-nejm
HOBBY

a year ago

imma try to fix this to see if this is the problem


a year ago

yeah connect ECONNREFUSED ::1:6379
this deploy hasnt started its web server so its not going to answer the health check


theo-nejm
HOBBY

a year ago

yeah, ive imagined, forgot about the redis


theo-nejm
HOBBY

a year ago

tks


theo-nejm
HOBBY

a year ago

hmmm redis connection still refused


theo-nejm
HOBBY

a year ago

but now ive configured the variables


theo-nejm
HOBBY

a year ago

yeah, econnrefused ::1.6379


theo-nejm
HOBBY

a year ago

looks like it cant connect to db


theo-nejm
HOBBY

a year ago

is this possible to connect via internal host?
redis.railway.internal


theo-nejm
HOBBY

a year ago

i've set my envs
REDISHOST REDISPORT
REDIS_PASSWORD


theo-nejm
HOBBY

a year ago

another question, my estimated usage went from 5 cents/mo to $2/mo when I set up redis, is that correct?


theo-nejm
HOBBY

a year ago

is there anything I can do to connect redis in this cases?


a year ago

you set the variables, but are you consuming them in code?


theo-nejm
HOBBY

a year ago

yes, sure


theo-nejm
HOBBY

a year ago

export const RedisOptions: CacheModuleAsyncOptions = {
  isGlobal: true,
  imports: [ConfigModule],
  useFactory: async (configService: ConfigService) => {
    return {
      store: redisStore,
      host: configService.get('REDIS_HOST'),
      port: Number(configService.get('REDIS_PORT')!),
      password: configService.get('REDIS_PASSWORD'),
    };
  },
  inject: [ConfigService],
};


theo-nejm
HOBBY

a year ago

can this be the problem?


theo-nejm
HOBBY

a year ago

i managed to fixed it by adding family: 0 in my redis config. it seems needs when connecting to private network

theo-nejm
HOBBY

a year ago

is this needed?


a year ago

i dont know if that would be valid syntax, but given you are getting econnrefused ::1.6379 im going to say no, that is not valid syntax


theo-nejm
HOBBY

a year ago

it is a valid syntax, locally it works with my redis


a year ago

not necessarily, if it was valid your app would not be attempting to connect to ::1


a year ago

thats a fallback hostname that indicates that the redis client is using its default values to attempt a redis connection, instead of using the REDIS_HOST


a year ago

no its has nothing to do with the current error


theo-nejm
HOBBY

a year ago

k got it


theo-nejm
HOBBY

a year ago

solved the problem here


theo-nejm
HOBBY

a year ago

all done


a year ago

awsome, what was the issue


theo-nejm
HOBBY

a year ago

actually the lib's doc was wrong


a year ago

you'll have that


theo-nejm
HOBBY

a year ago

the lib that integrates redis on nest


theo-nejm
HOBBY

a year ago

well, the last update was in 2022, its expected haha


a year ago

makes sense, glad you got it fixed


theo-nejm
HOBBY

a year ago

tks for the help, Brody


a year ago

no problem!


Delete tables/databases on railway - Railway Help Station